diff options
author | Andrey Zelenkov <zelenkov@nginx.com> | 2019-02-27 19:15:02 +0300 |
---|---|---|
committer | Andrey Zelenkov <zelenkov@nginx.com> | 2019-02-27 19:15:02 +0300 |
commit | 4de2c8b56719fce6b95b6f8a613b349590a3676f (patch) | |
tree | 28db74ede291a8cd16c34fdaa277370929a2ecfe /test/test_tls.py | |
parent | 379e4c75fdf99439e481f739324d9c6d6d1b18ab (diff) | |
download | unit-4de2c8b56719fce6b95b6f8a613b349590a3676f.tar.gz unit-4de2c8b56719fce6b95b6f8a613b349590a3676f.tar.bz2 |
Tests: added "Host" and "Connetion" headers where necessary.
Also minor header organizing.
Diffstat (limited to 'test/test_tls.py')
-rw-r--r-- | test/test_tls.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/test/test_tls.py b/test/test_tls.py index dc2f4505..2131bf30 100644 --- a/test/test_tls.py +++ b/test/test_tls.py @@ -313,8 +313,8 @@ basicConstraints = critical,CA:TRUE""" % { self.certificate() (resp, sock) = self.get(headers={ - 'Connection': 'keep-alive', - 'Host': 'localhost' + 'Host': 'localhost', + 'Connection': 'keep-alive' }, start=True) self.assertEqual(resp['status'], 200, 'initial status') @@ -334,17 +334,17 @@ basicConstraints = critical,CA:TRUE""" % { self.add_tls(application='mirror') (resp, sock) = self.post_ssl(headers={ + 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', - 'Host': 'localhost' + 'Content-Type': 'text/html' }, start=True, body='0123456789') self.assertEqual(resp['body'], '0123456789', 'keepalive 1') resp = self.post_ssl(headers={ + 'Host': 'localhost', 'Connection': 'close', - 'Content-Type': 'text/html', - 'Host': 'localhost' + 'Content-Type': 'text/html' }, sock=sock, body='0123456789') self.assertEqual(resp['body'], '0123456789', 'keepalive 2') @@ -358,8 +358,8 @@ basicConstraints = critical,CA:TRUE""" % { self.add_tls() (resp, sock) = self.get_ssl(headers={ - 'Connection': 'keep-alive', - 'Host': 'localhost' + 'Host': 'localhost', + 'Connection': 'keep-alive' }, start=True) self.conf({ @@ -369,8 +369,8 @@ basicConstraints = critical,CA:TRUE""" % { try: resp = self.get_ssl(headers={ - 'Connection': 'close', - 'Host': 'localhost' + 'Host': 'localhost', + 'Connection': 'close' }, sock=sock) except: resp = None @@ -397,9 +397,9 @@ basicConstraints = critical,CA:TRUE""" % { self.add_tls(application='mirror') (resp, sock) = self.post_ssl(headers={ + 'Host': 'localhost', 'Connection': 'keep-alive', - 'Content-Type': 'text/html', - 'Host': 'localhost' + 'Content-Type': 'text/html' }, start=True, body='0123456789') app_id = self.findall(r'(\d+)#\d+ "mirror" application started')[0] @@ -410,9 +410,9 @@ basicConstraints = critical,CA:TRUE""" % { '#)(\d+)#\d+ "mirror" application started')) resp = self.post_ssl(headers={ + 'Host': 'localhost', 'Connection': 'close', - 'Content-Type': 'text/html', - 'Host': 'localhost' + 'Content-Type': 'text/html' }, sock=sock, body='0123456789') self.assertEqual(resp['status'], 200, 'application respawn status') |