mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 11:09:04 -04:00
Fix parsing the Sec-WebSocket-Protocol header.
This commit is contained in:
parent
1befd6ea00
commit
0412fc0f40
@ -415,9 +415,11 @@ class WebSocketHook : public IOHookMiddle
|
|||||||
HTTPHeaderFinder protocolheader;
|
HTTPHeaderFinder protocolheader;
|
||||||
if (protocolheader.Find(recvq, "Sec-WebSocket-Protocol:", 23, reqend))
|
if (protocolheader.Find(recvq, "Sec-WebSocket-Protocol:", 23, reqend))
|
||||||
{
|
{
|
||||||
irc::spacesepstream protostream(protocolheader.ExtractValue(recvq));
|
irc::commasepstream protostream(protocolheader.ExtractValue(recvq));
|
||||||
for (std::string proto; protostream.GetToken(proto); )
|
for (std::string proto; protostream.GetToken(proto); )
|
||||||
{
|
{
|
||||||
|
proto.erase(std::remove_if(proto.begin(), proto.end(), ::isspace), proto.end());
|
||||||
|
|
||||||
bool is_binary = stdalgo::string::equalsci(proto, "binary.inspircd.org");
|
bool is_binary = stdalgo::string::equalsci(proto, "binary.inspircd.org");
|
||||||
bool is_text = stdalgo::string::equalsci(proto, "text.inspircd.org");
|
bool is_text = stdalgo::string::equalsci(proto, "text.inspircd.org");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user