Backport support for the IRCv3 websocket subprotocols.

This commit is contained in:
Sadie Powell 2024-11-07 22:28:40 +00:00
parent cf87603832
commit 87145f5790

View File

@ -450,8 +450,11 @@ class WebSocketHook : public IOHookMiddle
{
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");
bool is_binary = (sock->type == StreamSocket::SS_USER && stdalgo::string::equalsci(proto, "binary.ircv3.net"))
|| stdalgo::string::equalsci(proto, "binary.inspircd.org");
bool is_text = (sock->type == StreamSocket::SS_USER && stdalgo::string::equalsci(proto, "text.ircv3.net"))
|| stdalgo::string::equalsci(proto, "text.inspircd.org");
if (is_binary || is_text)
{