aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_websocket.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-10-05 12:39:07 +0100
committerGravatar Sadie Powell2021-10-05 12:39:07 +0100
commit139f0bdd471c20256b7fe27c5edcb2032fd356cd (patch)
tree06f7ed79f41ce86a0dd4f657052ce7e3a11b9b2b /src/modules/m_websocket.cpp
parentApply the final keyword to all module classes where appropriate. (diff)
parentMake the deprecation of LibreSSL support more explicit. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_websocket.cpp')
-rw-r--r--src/modules/m_websocket.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp
index 530e4a62d..6555d3ad7 100644
--- a/src/modules/m_websocket.cpp
+++ b/src/modules/m_websocket.cpp
@@ -417,9 +417,11 @@ class WebSocketHook final
HTTPHeaderFinder protocolheader;
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); )
{
+ proto.erase(std::remove_if(proto.begin(), proto.end(), ::isspace), proto.end());
+
bool is_binary = stdalgo::string::equalsci(proto, "binary.inspircd.org");
bool is_text = stdalgo::string::equalsci(proto, "text.inspircd.org");