#692 Remove closing of the WebSocket if no subprotocol is matching

This commit is contained in:
Pierre Jacobs 2024-01-14 17:30:11 +01:00
parent 06d68ce877
commit ebd1708251

View File

@ -101,14 +101,7 @@ namespace crow
{
auto requested_subprotocols = utility::split(requested_subprotocols_header, ", ");
auto subprotocol = utility::find_first_of(subprotocols.begin(), subprotocols.end(), requested_subprotocols.begin(), requested_subprotocols.end());
if (subprotocol == subprotocols.end())
{
adaptor_.close();
handler_->remove_websocket(this);
delete this;
return;
}
else
if (subprotocol != subprotocols.end())
{
subprotocol_ = *subprotocol;
}