coder / coder/websocket

Header gets normalized when using req.Header.Set

Open
#553 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
5.5k
Forks
372
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.