Attempt to close with local-only codes (e.g. 1006) results in normal close (1000)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- networking
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Python
- Stars
- 303
- Forks
- 57
- 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 python-hyper/wsproto
-
Compression Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
python-hyper/wsproto#199 · 5 comments ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 48/100
python-hyper/wsproto#173 · 1 comment ·
All issues in python-hyper/wsproto
Similar issues
-
from:qa priority:P2 reliability tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
spec-kitty/spec-kitty#4874 ·
-
fix: inaccuracy ⚠️
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
uabrc/uabrc.github.io#1255 · 1 comment ·
-
kind:bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ethereum-optimism/factory#64 ·