diff --git a/RELICENSE/sab24.md b/RELICENSE/sab24.md new file mode 100644 index 00000000..4d4acfcd --- /dev/null +++ b/RELICENSE/sab24.md @@ -0,0 +1,14 @@ +# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL + +This is a statement by Bart Smink +that grants permission to relicense its copyrights in the libzmq C++ +library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other +Open Source Initiative approved license chosen by the current +ZeroMQ BDFL (Benevolent Dictator for Life). + +A portion of the commits made by the Github handle "sab24", with +commit author "sab24 ", are copyright of Bart Smink. +This document hereby grants the libzmq project team to relicense libzmq, +including all past, present and future contributions of the author listed above. + +Bart Smink 2021/01/30 diff --git a/src/ws_engine.cpp b/src/ws_engine.cpp index a239330c..cb5510e1 100644 --- a/src/ws_engine.cpp +++ b/src/ws_engine.cpp @@ -453,9 +453,18 @@ bool zmq::ws_engine_t::server_handshake () if (strcasecmp ("upgrade", _header_name) == 0) _header_upgrade_websocket = strcasecmp ("websocket", _header_value) == 0; - else if (strcasecmp ("connection", _header_name) == 0) - _header_connection_upgrade = - strcasecmp ("upgrade", _header_value) == 0; + else if (strcasecmp ("connection", _header_name) == 0){ + char *element = strtok (_header_value, ","); + while (element != NULL){ + while (*element == ' ') + element++; + if (strcasecmp ("upgrade", element) == 0){ + _header_connection_upgrade = true; + break; + } + element = strtok (NULL, ","); + } + } else if (strcasecmp ("Sec-WebSocket-Key", _header_name) == 0) strcpy_s (_websocket_key, _header_value);