-
Notifications
You must be signed in to change notification settings - Fork 207
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
Spec: Added reason
to WebSocket Disconnect
#462
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
HTTP & WebSocket ASGI Message Format | ||
==================================== | ||
|
||
**Version**: 2.4 (2024-01-16) | ||
**Version**: 2.5 (2024-06-05) | ||
|
||
The HTTP+WebSocket ASGI sub-specification outlines how to transport HTTP/1.1, | ||
HTTP/2 and WebSocket connections within ASGI. | ||
|
@@ -22,6 +22,7 @@ This spec has had the following versions: | |
* ``2.2``: Allow ``None`` in the second item of ``server`` scope value. | ||
* ``2.3``: Added the ``reason`` key to the WebSocket close event. | ||
* ``2.4``: Calling ``send()`` on a closed connection should raise an error | ||
* ``2.5``: Added the ``reason`` key to the WebSocket disconnect event. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need a bump on the spec? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not for me to say, but I saw it was done similarly for 2.3. Can remove it if not needed :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, any spec change should minor bump if it's backwards-compatible (like this) and a major bump if it is not. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You did miss out updating the main version number though - we'll need that bumped too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Done 👍 |
||
|
||
Spec versions let you understand what the server you are using understands. If | ||
a server tells you it only supports version ``2.0`` of this spec, then | ||
|
@@ -457,6 +458,10 @@ Keys: | |
was received in the frame from the client, the server should set this to ``1005`` | ||
(the default value in the WebSocket specification). | ||
|
||
* ``reason`` (*Unicode string*) -- A reason given for the disconnect, can | ||
be any string. Optional; if missing or ``None`` default is empty | ||
string. | ||
|
||
|
||
Disconnected Client - ``send`` exception | ||
'''''''''''''''''''''''''''''''''''''''' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewgodwin Can we start using
NotRequired
on those?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately that only appears in 3.11...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asgiref
depends ontyping_extensions
, so it's already possible.