Header gets normalized when using req.Header.Set
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go
- Domain
- networking
Research direction
Start by tracing request header construction from req.Header.Set and reproduce the handshake with Sec-WebSocket-Key. Compare the header name sent by this library with the expected spelling and check the relevant request or handshake tests. Done means the handshake succeeds when this header is set and the behavior is covered by a test.
Written by the indexing model from the issue text.
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.
- Dominant language
- Go
- Stars
- 5.5k
- Forks
- 377
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/websocket
-
Must not wrap io.EOF Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
export wstest Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
Similar issues
-
textual definition
Difficulty 1/5 Under an hour Newbie friendliness 90/100
geneontology/go-ontology#32653 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
needs design
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100