Skip to content

webRequest.onHeadersReceived does not lower case header names #880

@devinbinnie

Description

@devinbinnie

Was asked to create a ticket here for discussion by the Chromium team: https://issues.chromium.org/issues/447256830#comment2

The webRequest.onHeadersReceived listener returns an object with response headers, however, these headers seem to be case sensitive as the API returns them in whatever casing the server provides.

As per https://www.rfc-editor.org/rfc/rfc9110.html#section-5.1-3, headers are supposed to be case insensitive, so this can make it hard to detect certain header names. I ran into this using Electron when trying to intercept headers from web requests in my application (relevant Electron bug: github.com/electron/electron/issues/48365)

It might be a breaking change to do this, but I'm thinking it makes more sense to force the headers to return in all lowercase, such that it doesn't matter what the server sends.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage: chromeChrome needs to assess this issue for the first timeneeds-triage: firefoxFirefox needs to assess this issue for the first timeneeds-triage: safariSafari needs to assess this issue for the first time

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions