Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So you can say:

    let r = await fetch(...);
    if(!r.ok) ...
    let len = response.headers.get("Content-Length");
    if(!len || new Number(len) > 1000 * 1000)
        throw new Error("Eek!");


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: