From ddb1db9a2c3786ed3412259d9a0b1b050df88c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 7 Jun 2024 12:33:17 +0200 Subject: [PATCH] tests: reset option relay.network.websocket_allowed_origins after changing it in tests (issue #2127) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 but was difference starts at position 9 at: < HTTP/1.1 403 Forbid> --- tests/unit/plugins/relay/test-relay-websocket.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/plugins/relay/test-relay-websocket.cpp b/tests/unit/plugins/relay/test-relay-websocket.cpp index 4c44850cc..d9df3e900 100644 --- a/tests/unit/plugins/relay/test-relay-websocket.cpp +++ b/tests/unit/plugins/relay/test-relay-websocket.cpp @@ -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);