Tests: improved response receiving while upgrade.

The patch required to process non-101 response.
This commit is contained in:
Max Romanov
2020-09-22 12:40:35 +03:00
parent 767c4cb508
commit dc49c561e2

View File

@@ -58,10 +58,7 @@ class TestApplicationWebsocket(TestApplicationProto):
resp += sock.recv(4096).decode() resp += sock.recv(4096).decode()
if ( if (resp.startswith('HTTP/') and '\r\n\r\n' in resp):
re.search('101 Switching Protocols', resp)
and resp[-4:] == '\r\n\r\n'
):
resp = self._resp_to_dict(resp) resp = self._resp_to_dict(resp)
break break