coder / coder/websocket

Header gets normalized when using req.Header.Set

オープン
#553 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
5.5k
フォーク
372
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず req.Header.Set からリクエストヘッダーの構築をたどり、Sec-WebSocket-Key を使ったハンドシェイクを再現します。このライブラリが送信するヘッダー名を期待される表記と比較し、関連するリクエストまたはハンドシェイクのテストを確認します。完了条件は、このヘッダーが設定されたときにハンドシェイクが成功し、その動作がテストでカバーされていることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
go
領域
networking
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。