You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|Sec-WebSocket-Protocol| header field, with a list of values indicating which protocols the client would like to speak, ordered by preference.
And for server side:
Either a single value representing the subprotocol the server is ready to use or null. The value chosen MUST be derived from the client's handshake, specifically by selecting one of the values from the |Sec-WebSocket-Protocol| field that the server is willing to use for this connection (if any).
So if the client provides a few options for subprotocol. The server should choose the first one it supports.
Right now, if client provides a few options, lib choose the first one it supports (and not the first one from the client).
e.g. So if the client sends Sec-WebSocket-Protocol: wamp.2.cbor, wamp.2,json and server supports wamp.2,json, wamp.2.cbor then wamp.2,json will be chosen but not wamp.2.cbor as it should be.
A clear and concise description of what the bug is.
Lib version: all :)
Code Snippets
The problem is in server.go: selectSubprotocol func:
Fixes#822
**Summary of Changes**
1. Changed the order of subprotocol selection to prefer client one
---------
Co-authored-by: Corey Daley <[email protected]>
Describe the bug
From the Websocket RFC6455:
For client side:
And for server side:
So if the client provides a few options for subprotocol. The server should choose the first one it supports.
Right now, if client provides a few options, lib choose the first one it supports (and not the first one from the client).
e.g. So if the client sends Sec-WebSocket-Protocol: wamp.2.cbor, wamp.2,json and server supports wamp.2,json, wamp.2.cbor then wamp.2,json will be chosen but not wamp.2.cbor as it should be.
Lib version: all :)
Code Snippets
The problem is in
server.go
: selectSubprotocol func:should be changed to:
The text was updated successfully, but these errors were encountered: