Denying WebSocket connection in WebSocketEndpoint.on_connect leads to Exception #1555
Answered
by
Kludex
dingensundso
asked this question in
Potential Issue
-
I created a WebSocketEndpoint class in which I want to deny the connection in certain conditions.
So code is None when the server denies the connection instead of non-existant. starlette/starlette/endpoints.py Lines 72 to 87 in e086fc2 Changing line 83 to the following should fix the issue: close_code = int(message.get("code") or status.WS_1000_NORMAL_CLOSURE) |
Beta Was this translation helpful? Give feedback.
Answered by
Kludex
Mar 30, 2022
Replies: 1 comment
-
Created #1560 from this discussion. Thanks for bringing it up. :) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kludex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created #1560 from this discussion. Thanks for bringing it up. :)