Closed
Description
In https://asgi.readthedocs.io/en/latest/specs/www.html#disconnect-receive-event-ws it does not say code is optional, yet it says "as per websocket spec", where code is optional ("may contain"). Later on in Close - send event
it explicitly mentions that the code there is optional. In the first link should code be optional or required?
If code is optional I would be happy to submit a PR to this repo to update the docs.
This is not just a theoretical question, as we are facing a bug that may be related to this. In https://github.com/django/channels/blob/38324816c115567e198a573bc294d8345df5e8a9/channels/generic/websocket.py#L105 channels assumes that the code
key exists, but in our case it doesn't exist and a KeyError is raised.
Metadata
Metadata
Assignees
Labels
No labels