From dc49c561e204fd70008aa6af8c6171ef7d227db1 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Tue, 22 Sep 2020 12:40:35 +0300 Subject: Tests: improved response receiving while upgrade. The patch required to process non-101 response. --- test/unit/applications/websockets.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'test/unit/applications/websockets.py') diff --git a/test/unit/applications/websockets.py b/test/unit/applications/websockets.py index f1ddf630..cb9f40aa 100644 --- a/test/unit/applications/websockets.py +++ b/test/unit/applications/websockets.py @@ -58,10 +58,7 @@ class TestApplicationWebsocket(TestApplicationProto): resp += sock.recv(4096).decode() - if ( - re.search('101 Switching Protocols', resp) - and resp[-4:] == '\r\n\r\n' - ): + if (resp.startswith('HTTP/') and '\r\n\r\n' in resp): resp = self._resp_to_dict(resp) break -- cgit