summaryrefslogtreecommitdiffhomepage
path: root/test/test_tls.py
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2019-03-21 13:55:57 +0300
committerMax Romanov <max.romanov@nginx.com>2019-03-21 13:55:57 +0300
commit452ce0789e8e8f1ac98cc0ed7efce03656a3d616 (patch)
tree395a7f6964448568ec8521e6cd1338763a9d743f /test/test_tls.py
parent39e147a858e7d135aa224a308b4d41061e00c296 (diff)
downloadunit-452ce0789e8e8f1ac98cc0ed7efce03656a3d616.tar.gz
unit-452ce0789e8e8f1ac98cc0ed7efce03656a3d616.tar.bz2
Adjusting request schema value according to connection tls state.
This closes #223 issue on GitHub.
Diffstat (limited to 'test/test_tls.py')
-rw-r--r--test/test_tls.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_tls.py b/test/test_tls.py
index 2131bf30..d9b2e512 100644
--- a/test/test_tls.py
+++ b/test/test_tls.py
@@ -418,5 +418,26 @@ basicConstraints = critical,CA:TRUE""" % {
self.assertEqual(resp['status'], 200, 'application respawn status')
self.assertEqual(resp['body'], '0123456789', 'application respawn body')
+ def test_tls_url_scheme(self):
+ self.load('variables')
+
+ self.assertEqual(self.post(headers={
+ 'Host': 'localhost',
+ 'Content-Type': 'text/html',
+ 'Custom-Header': '',
+ 'Connection': 'close'
+ })['headers']['Wsgi-Url-Scheme'], 'http', 'url scheme http')
+
+ self.certificate()
+
+ self.add_tls(application='variables')
+
+ self.assertEqual(self.post_ssl(headers={
+ 'Host': 'localhost',
+ 'Content-Type': 'text/html',
+ 'Custom-Header': '',
+ 'Connection': 'close'
+ })['headers']['Wsgi-Url-Scheme'], 'https', 'url scheme https')
+
if __name__ == '__main__':
TestUnitTLS.main()