Closed wendy5667 closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
206bb38
) to head (a53ba4c
). Report is 1 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
- I'm not sure if we can always
send()
areason
indiscriminately inside an ASGI WebSocket protocol message. Maybe it's safer to only include areason
iff we've verified we're dealing with ASGI HTTP+WebSocket protocol spec version 2.3+?
I agree, this seems the safest option
- We need to write a newsfragment for the new feature you've implemented.
Could you kindly share the style guide for newsfragments? I couldn't find it in the Contributor's Guide. Thank you!
sorry @wendy5667 we kinda forgot this PR. I'll try to bringing it over the finishing line.
Furthermore, unfortunately it seems that the code got affected by a botched master merge. I can try to fix these things.
Summary of Changes
This PR adds
reason
to Websocket.close() as specified in version 2.3 of the HTTP & WebSocket ASGI Message Format. Closure due toHTTPError
s are rendered automatically from HTTP status code, while others are rendered by a default mapping, which could be changed by users.Related Issues
Closes #2025
Pull Request Checklist
docs/
.docs/
.versionadded
,versionchanged
, ordeprecated
directives.docs/_newsfragments/
, with the file name format{issue_number}.{fragment_type}.rst
. (Runtowncrier --draft
to ensure it renders correctly.)