Attempt to close with local-only codes (e.g. 1006) results in normal close (1000)

オープン
#182 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
networking

調査の方向性

Start at src/wsproto/frame_protocol.py lines 576-577 and trace how an attempted close with code 1006 is handled. Confirm the WebSocket protocol's expected behavior for local-only close codes, then define a regression test showing that 1006 is not converted into a normal 1000 closure.

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

説明

Currently, if you close a websocket with code 1006 (which is not allowed), the result is a 1000-code closure:
https://github.com/python-hyper/wsproto/blob/main/src/wsproto/frame_protocol.py#L576-L577

I suspect this should instead be either a 1002 error or an exception, but I'm not certain.

This resulted in a latent bug in hypercorn (an ASGI web server that uses wsproto) where websockets were closed with code 1000 on internal server errors:
https://github.com/pgjones/hypercorn/pull/112

主要言語
Python
スター
303
フォーク
57
PR マージ指標
30日以内にマージされた PR はありません

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python-hyper/wsproto のほかの issue

python-hyper/wsproto の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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