Skip to content

Header gets normalized when using req.Header.Set #553

@blluv

Description

@blluv

Setting headers via req.Header.Set causes header names to get normalized (e.g. Sec-WebSocket-Key -> Sec-Websocket-Key).
With gorilla/websocket, the same server accepts the connection without issues, but using this library the handshake fails.

After debugging, I found that the server was specifically expecting Sec-WebSocket-Key, while the client sent the normalized name.
Servers should ideally treat headers case-insensitively, but the normalization might be unintentional, so I wanted to report it.

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