Skip to content

Conversation

@pankaj-bind
Copy link

Currently, the ws_protocol.py module does not validate the sec-websocket-protocol header, which can lead to malformed subprotocol lists being passed to the ASGI application. This can cause unexpected behavior and runtime errors if the application is not prepared to handle non-string or otherwise invalid subprotocol values.

This update introduces validation for WebSocket subprotocols to prevent potential runtime errors and improve the robustness of the server.

These changes ensure that Daphne handles malformed sec-websocket-protocol headers gracefully, making the server more resilient and preventing potential application-level errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant