summaryrefslogtreecommitdiffhomepage
path: root/test/unit
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-09-22 12:40:35 +0300
committerMax Romanov <max.romanov@nginx.com>2020-09-22 12:40:35 +0300
commitdc49c561e204fd70008aa6af8c6171ef7d227db1 (patch)
tree30a88a03d60c9dd8744fdfe0cba70dca27985171 /test/unit
parent767c4cb50899d6086430ff4ed86d06352ffa974d (diff)
downloadunit-dc49c561e204fd70008aa6af8c6171ef7d227db1.tar.gz
unit-dc49c561e204fd70008aa6af8c6171ef7d227db1.tar.bz2
Tests: improved response receiving while upgrade.
The patch required to process non-101 response.
Diffstat (limited to '')
-rw-r--r--test/unit/applications/websockets.py5
1 files changed, 1 insertions, 4 deletions
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