Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
samsamoa opened this issue Mar 18, 2023 · 0 comments

Comments

@samsamoa
Copy link

samsamoa commented Mar 18, 2023

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:
pgjones/hypercorn#112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant