-
-
Notifications
You must be signed in to change notification settings - Fork 147
Description
I have observed an inconsistency in how WebSocket subprotocols are handled compared to other ASGI server implementations.
Specifically, Granian does not split the Sec-WebSocket-Protocol header into separate subprotocol strings. Instead, it returns a single combined string.
Client Websocket Opening Handshake
Sec-WebSocket-Protocol: bokeh, Token
Observed Behavior (Granian)
scope["subprotocols"] == ['bokeh, Token']Expected / Common Behavior (Other ASGI servers)
Other ASGI servers such as Uvicorn, Hypercorn, and Daphne split the subprotocol header into a list of individual protocol strings:
scope["subprotocols"] == ['bokeh', 'Token']This behavior was observed when using Django together with bokeh_django under Granian.
Other ASGI servers split the header value. Returning a single combined string may cause compatibility issues with frameworks or libraries that expect a list of individual subprotocols.
Is this behaviour intentional? If not, would it be possible to align Granian’s handling of WebSocket subprotocols with other ASGI server implementations?