aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_websocket.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-07-31 14:27:10 +0100
committerGravatar Sadie Powell2024-07-31 14:27:10 +0100
commit5c09bb5b67b45711f96514cb600b3befe36616c9 (patch)
treeb73fe149ee29b1ed7485bfdae85feed842f6417d /src/modules/m_websocket.cpp
parentImprove the paths picked up by Doxygen. (diff)
downloadinspircd++-5c09bb5b67b45711f96514cb600b3befe36616c9.tar.gz
inspircd++-5c09bb5b67b45711f96514cb600b3befe36616c9.tar.bz2
inspircd++-5c09bb5b67b45711f96514cb600b3befe36616c9.zip
Only allow the IRCv3 WebSocket subprotocols on client connections.
Diffstat (limited to 'src/modules/m_websocket.cpp')
-rw-r--r--src/modules/m_websocket.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp
index edf90db22..5167c7faa 100644
--- a/src/modules/m_websocket.cpp
+++ b/src/modules/m_websocket.cpp
@@ -472,10 +472,10 @@ class WebSocketHook final
{
proto.erase(std::remove_if(proto.begin(), proto.end(), ::isspace), proto.end());
- bool is_binary = insp::equalsci(proto, "binary.ircv3.net")
+ auto is_binary = (sock->type == StreamSocket::SS_USER && insp::equalsci(proto, "binary.ircv3.net"))
|| insp::equalsci(proto, "binary.inspircd.org");
- bool is_text = insp::equalsci(proto, "text.ircv3.net")
+ auto is_text = (sock->type == StreamSocket::SS_USER && insp::equalsci(proto, "text.ircv3.net"))
|| insp::equalsci(proto, "text.inspircd.org");
if (is_binary || is_text)