Closed ancs21 closed 1 month ago
Thanks for reporting @ancs21! We can adjust the code to handle missing subprotocols more gracefully.
However, I'm not sure whether we want to reject the websocket connection in this case or pick one of the two graphql websocket protocols. While both graphql websocket protocols name the subprotocol associated with them, I'm not sure whether they're strictly required. Need to look around and check how other implementations handle this case since the specs are not clear about it.
@DoctorJohn Granian maintainer here. I think in the case you can't fallback to a default value for this, the best approach would be to reject the connection, as the lack of subprotocols
optional key in ASGI scope just means the server is not implementing such feature.
As a side note, there's a specific issue in Granian to add subprotocols
support, thus in the future this will be implicitly solved on Granian side, but I really think Strawberry should respect ASGI standard here :)
This has been addressed in #3638. Connections are now getting rejected if client and server fail to negotiate a subprotocol.
Describe the Bug
I use the
granian
HTTP Server support ASGI and get a issue belowAs mentioned by @gi0baro here https://github.com/emmett-framework/granian/issues/213#issuecomment-1952012787
System Information
Upvote & Fund