diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-09-22 12:40:35 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-09-22 12:40:35 +0300 |
commit | dc49c561e204fd70008aa6af8c6171ef7d227db1 (patch) | |
tree | 30a88a03d60c9dd8744fdfe0cba70dca27985171 | |
parent | 767c4cb50899d6086430ff4ed86d06352ffa974d (diff) | |
download | unit-dc49c561e204fd70008aa6af8c6171ef7d227db1.tar.gz unit-dc49c561e204fd70008aa6af8c6171ef7d227db1.tar.bz2 |
Tests: improved response receiving while upgrade.
The patch required to process non-101 response.
-rw-r--r-- | test/unit/applications/websockets.py | 5 |
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 |