Skip to content

HTTP/2 and Content-Length #1786

Open
Open
@annevk

Description

@annevk

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs testsMoving the issue forward requires someone to write teststopic: http

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions