coder / coder/websocket

Header gets normalized when using req.Header.Set

Aperta
#553 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
5.5k
Fork
372
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.