mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-08 12:23:47 +00:00
Ignore a subprotocol the WebSocket client did not offer
A SubProtocolSelector could return a value outside the client's Sec-WebSocket-Protocol list, and the server sent it back as is. The server now treats such a value as no selection.
This commit is contained in:
@@ -119,7 +119,7 @@ using SubProtocolSelector =
|
||||
std::function<std::string(const std::vector<std::string> &protocols)>;
|
||||
```
|
||||
|
||||
The `SubProtocolSelector` receives the list of subprotocols proposed by the client (from the `Sec-WebSocket-Protocol` header) and returns the selected one. Return an empty string to decline all proposed subprotocols.
|
||||
The `SubProtocolSelector` receives the list of subprotocols proposed by the client (from the `Sec-WebSocket-Protocol` header) and returns the selected one. Return an empty string to decline all proposed subprotocols. A returned value that the client did not propose is ignored.
|
||||
|
||||
### WebSocket (Server-side)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user