Adjusting request schema value according to connection tls state.

This closes #223 issue on GitHub.
This commit is contained in:
Max Romanov
2019-03-21 13:55:57 +03:00
parent 39e147a858
commit 452ce0789e
14 changed files with 103 additions and 31 deletions

View File

@@ -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()