-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Missing close status codes for websockets #5192
Comments
@achimnol do you mean that the values are missing in the |
There is an interesting question: how to prevent such problem in future, when a new code will be added again? |
It could be a GitHub action that periodically fetchs the https://github.com/mdn/content/blob/main/files/en-us/web/api/closeevent/index.html , parses it and compares to the enum in master branch. In case of mismatch creates an issue with a tag. |
@achimnol I think 1015 shouldn't be set in aiohttp. The connection error should be raised in this case IMHO.
|
Even the original RFC and its follow-up docs does not specify all of the close codes listed in the MDN document. I agree with that 1015 might not be necessary for the application layer, i.e., aiohttp., but if we decide to accept any status code in the range of 1000 to 4999, this wouldn't be important anyway. |
I think we are talking not only the enum values, but also about the handing the "unexpected" close codes. aiohttp/aiohttp/http_websocket.py Lines 282 to 293 in 2a9d5e9
IMO the question is: should we change this behavior and how? May be it would be better to raise an excpetion if the code is not OK (1000). |
🐞 Describe the bug
ref: https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
current: https://github.com/aio-libs/aiohttp/blob/707736b/aiohttp/http_websocket.py#L31-L42
The close code 1014, 1015 is missing, and one of my use case (websocket proxy) involves 1014,
which results in an unexpected error "Invalid close code: 1014".
I think we need to update the list.
The text was updated successfully, but these errors were encountered: