diff --git a/include/struct.h b/include/struct.h index c96fcd907..79e1a489d 100644 --- a/include/struct.h +++ b/include/struct.h @@ -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 */ diff --git a/src/modules/websocket.c b/src/modules/websocket.c index 2a7bea30b..54ecbf610 100644 --- a/src/modules/websocket.c +++ b/src/modules/websocket.c @@ -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; } diff --git a/src/modules/websocket_common.c b/src/modules/websocket_common.c index a5f0d42b2..81f4cb2f9 100644 --- a/src/modules/websocket_common.c +++ b/src/modules/websocket_common.c @@ -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); } }