Skip to content

setHeaderOptions should normalize header keys #2690

@simhnna

Description

@simhnna

Describe the bug
Currently to override any header that's already set by the library you need to match the case. If the case changes for whatever reason the code breaks.
This causes hard to debug issues.

I suggest lowercasing all headers so they correctly override regardless of case used anywhere. HTTP1 defines header keys as case insensitive, HTTP2 requires lowercase headers. https://www.rfc-editor.org/rfc/rfc7540#section-8.1.2

If you don't decide to lowercase header keys right now, setHeaderOptions should at least compare the new keys to existing ones case insensitively and overwrite existing values instead of adding new entries

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions