Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP/2 and Content-Length #1786

Open
annevk opened this issue Nov 14, 2024 · 1 comment
Open

HTTP/2 and Content-Length #1786

annevk opened this issue Nov 14, 2024 · 1 comment
Labels
needs tests Moving the issue forward requires someone to write tests topic: http

Comments

@annevk
Copy link
Member

annevk commented Nov 14, 2024

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?

@annevk annevk added needs tests Moving the issue forward requires someone to write tests topic: http labels Nov 14, 2024
@LPardue
Copy link

LPardue commented Nov 14, 2024

Applies to HTTP/3 too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs tests Moving the issue forward requires someone to write tests topic: http
Development

No branches or pull requests

2 participants