Skip to content

Warn when sending uppercase HTTP/2 headers #4746

Closed

Description

@mhils

The following addon will make some requests fail with HTTP/2 protocol errors:

def request(flow):
    flow.request.headers["Content-Type"] = "application/json"

It's not immediately obvious what's the problem here, but HTTP/2 headers may only be lowercase. We are smart enough to automatically fix that for requests that we received as HTTP/1, but otherwise we intentionally just keep things as-is. This is hard to debug for addon authors, we should emit a warning if we see uppercase HTTP/2 headers being sent.

Activity

  1. added
    kind/ux
    on Aug 10, 2021
  2. Kriechi commented on Aug 13, 2021

    @Kriechi
    Member

    Why do we intentionally just keep things as-is?
    Why not apply the same smartness by default, and maybe provide a --strict mode or similar? Less surprises for most users, and for the advanced users, they can opt into a strict mode for tinkering with the protocols.

  3. mhils commented on Aug 18, 2021

    @mhils
    MemberAuthor

    Fair point. Let's add an option and normalize by default.

  4. added a commit that references this issue on Mar 16, 2022
    065afe1
  5. added a commit that references this issue on Mar 16, 2022
    148429c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/protocolskind/uxprio/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions