From 452ce0789e8e8f1ac98cc0ed7efce03656a3d616 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Thu, 21 Mar 2019 13:55:57 +0300 Subject: Adjusting request schema value according to connection tls state. This closes #223 issue on GitHub. --- test/test_tls.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test') 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() -- cgit