Support for Websocket Denial Response extension #1536
Unanswered
paulo-raca
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently when a websocket connection is rejected (Not found, authentication failure, etc),
the client always ends with either with a generic 403 response (triggered by "websocket.close" message) or a generic HTTP500 response (if an unhandled exception reaches the ASGI gateway)
Instead it is possible to return proper HTTP responses for those cases using the Websocket Denial Response ASGI extension
I have been working on adding this feature starlette, but I didn't get any feedback / reviews, so maybe I need to open a discussion first 🤔? Anyway, I'd love some feedback on this
My current PR is #1535. It is minimalist and adds support on testclient.
My previous PR was #1478, which also updated various middlewares (routing, authentication, exception, etc) to take advantage of it. As a result it was a bit bloated, hard to review and had a few conflicts during the last few weeks. Instead I now plan to send separate PRs for each middleware update if/when the initial PR gets merged
Beta Was this translation helpful? Give feedback.
All reactions