1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

tests: reset option relay.network.websocket_allowed_origins after changing it in tests (issue #2127)

This fixes a test failure when the test changing the option is executed before
this one:

…/tests/unit/plugins/relay/api/test-relay-api-protocol.cpp:799: error: Failure in TEST(RelayApiProtocolWithClient, RecvJson)
        expected <HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: Z5uTZwvwYNDm9w4HFGk26ijp/p0=

>
        but was  <HTTP/1.1 403 Forbidden
Content-Length: 0

>
        difference starts at position 9 at: < HTTP/1.1 403 Forbid>
This commit is contained in:
Sébastien Helleu
2024-06-07 12:33:17 +02:00
parent 26c000c6b0
commit ddb1db9a2c
@@ -165,6 +165,7 @@ TEST(RelayWebsocket, ClientHandshakeValid)
LONGS_EQUAL(-2, relay_websocket_client_handshake_valid (request));
hashtable_set (request->headers, "origin", "example.com");
LONGS_EQUAL(0, relay_websocket_client_handshake_valid (request));
config_file_option_reset (relay_config_network_websocket_allowed_origins, 1);
relay_websocket_deflate_reinit (request->ws_deflate);
relay_websocket_parse_extensions ("permessage-deflate", request->ws_deflate, 1);