whatwg / fetch

Fetch Standard
https://fetch.spec.whatwg.org/
Other
2.12k stars 332 forks source link

HTTP/2 and Content-Length #1786

Open annevk opened 2 days ago

annevk commented 2 days ago

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:

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?

LPardue commented 2 days ago

Applies to HTTP/3 too