Validate "mqtt" exists in comma delimited subprotocol header #726
Validate "mqtt" exists in comma delimited subprotocol header #726
Conversation
|
Here we are verifying the response from the websocket server, we should expect only one protocol in the response.
This is where I was confused by your reply to the earlier PR. We should ideally return to checking if the value equals "mqtt", not entirely sure if whitespace would be expected. |
|
Header will be included only once, but it's valid to specify multiple subprotocols in it right? e.g. if we want to specify two protocols, one option is to add that header multiple times Or we can only include it once I think the quoted text is referring to later case. |
|
The main point of the quote is:
i.e. the server must only respond with one chosen protocol, the first one from the list provided as header in the connection request |
|
Okie! thanks for pointing out, the standards should be more explicit ig, causing confusion in interpretations haha. Anyways, i tested different clients: So it would be fine if we just match "mqtt". 😄 |
This PR adds up on #724 and fixes behavior incase the header contains multiple subprotocols listed in a comma-delimited format.
Type of change
Checklist:
cargo fmtCHANGELOG.mdif it's relevant to the users of the library. If it's not relevant mention why.