[whatwg/fetch] HTTP/2 and Content-Length (Issue #1786)

When there is a mismatch with Content-Length in HTTP/2 it's considered a malformed response: https://www.rfc-editor.org/rfc/rfc9113.html#section-8.1.1

But this does not define exactly where the stream error occurs, which could lead to differences in how websites are displayed or more arbitrary responses are interpreted.

What seems reasonable to me, but this needs tests:

- If Content-Length is less: you get all the bytes and then an error.
- If Content-Length is more: you get all the bytes up to the length indicated by Content-Length and then an error.

I guess there's also a question if Content-Length gets parsed in the same way here as it does for HTTP/1. Ideally yes? 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1786
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/1786@github.com>

Received on Thursday, 14 November 2024 11:14:32 UTC