mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-29 10:16:38 +02:00
Remove WSU() items forwarded & secure, since these are in webserver nowadays.
This commit is contained in:
@@ -1962,8 +1962,6 @@ struct WebSocketUser {
|
||||
int lefttoparselen; /**< Length of lefttoparse buffer */
|
||||
WebSocketType type; /**< WEBSOCKET_TYPE_BINARY or WEBSOCKET_TYPE_TEXT */
|
||||
char *sec_websocket_protocol; /**< Only valid during parsing of the request, after that it is NULL again */
|
||||
char *forwarded; /**< Unparsed `Forwarded:` header, RFC 7239 */
|
||||
int secure; /**< If there is a Forwarded header, this indicates if the remote connection is secure */
|
||||
};
|
||||
|
||||
#define WEBSOCKET_MAGIC_KEY "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" /* see RFC6455 */
|
||||
|
||||
+4
-10
@@ -347,11 +347,6 @@ int websocket_handle_request(Client *client, WebRequest *web)
|
||||
{
|
||||
/* Save it here, will be processed later */
|
||||
safe_strdup(WSU(client)->sec_websocket_protocol, value);
|
||||
} else
|
||||
if (!strcasecmp(key, "Forwarded"))
|
||||
{
|
||||
/* will be processed later too */
|
||||
safe_strdup(WSU(client)->forwarded, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,10 +428,6 @@ int websocket_handle_request(Client *client, WebRequest *web)
|
||||
}
|
||||
}
|
||||
|
||||
/* If using a proxy, set the secure flag depending on what the proxy said */
|
||||
if (WEB(client)->forwarded)
|
||||
WSU(client)->secure = WEB(client)->forwarded->secure;
|
||||
|
||||
websocket_handshake_send_response(client);
|
||||
return 1;
|
||||
}
|
||||
@@ -447,8 +438,11 @@ int websocket_secure_connect(Client *client)
|
||||
* us that their [client]--[webirc gateway] connection is also
|
||||
* secure (eg: using https)
|
||||
*/
|
||||
if (IsSecureConnect(client) && websocket_md && WSU(client) && WSU(client)->forwarded && !WSU(client)->secure)
|
||||
if (IsSecureConnect(client) && websocket_md && WSU(client) &&
|
||||
WEB(client)->forwarded && !WEB(client)->forwarded->secure)
|
||||
{
|
||||
client->umodes &= ~UMODE_SECURE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -481,7 +481,6 @@ void websocket_mdata_free(ModData *m)
|
||||
safe_free(wsu->handshake_key);
|
||||
safe_free(wsu->lefttoparse);
|
||||
safe_free(wsu->sec_websocket_protocol);
|
||||
safe_free(wsu->forwarded);
|
||||
safe_free(m->ptr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user