diff options
author | Min ho Kim <minho42@gmail.com> | 2019-08-12 20:51:26 +1000 |
---|---|---|
committer | Carlton Gibson <carlton.gibson@noumenal.es> | 2019-08-12 12:51:26 +0200 |
commit | d7673d9edabf96a18176325cd7fde41d96d89bb8 (patch) | |
tree | b61d5a70338b5cf85cd9f298d3d55d61f4654aaf /tests/settings_tests | |
parent | f7e9db14bbd39a393260d0a8b44aae80cbb65c81 (diff) | |
download | django-d7673d9edabf96a18176325cd7fde41d96d89bb8.tar.gz |
Switched to use `HTTP_X_FORWARDED_PROTO` custom header in tests.
This is the conventional name: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto
Diffstat (limited to 'tests/settings_tests')
-rw-r--r-- | tests/settings_tests/tests.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/settings_tests/tests.py b/tests/settings_tests/tests.py index 3770d15a3d..d663f6e819 100644 --- a/tests/settings_tests/tests.py +++ b/tests/settings_tests/tests.py @@ -361,24 +361,24 @@ class SecureProxySslHeaderTest(SimpleTestCase): req = HttpRequest() self.assertIs(req.is_secure(), False) - @override_settings(SECURE_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTOCOL', 'https')) + @override_settings(SECURE_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTO', 'https')) def test_set_without_xheader(self): req = HttpRequest() self.assertIs(req.is_secure(), False) - @override_settings(SECURE_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTOCOL', 'https')) + @override_settings(SECURE_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTO', 'https')) def test_set_with_xheader_wrong(self): req = HttpRequest() - req.META['HTTP_X_FORWARDED_PROTOCOL'] = 'wrongvalue' + req.META['HTTP_X_FORWARDED_PROTO'] = 'wrongvalue' self.assertIs(req.is_secure(), False) - @override_settings(SECURE_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTOCOL', 'https')) + @override_settings(SECURE_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTO', 'https')) def test_set_with_xheader_right(self): req = HttpRequest() - req.META['HTTP_X_FORWARDED_PROTOCOL'] = 'https' + req.META['HTTP_X_FORWARDED_PROTO'] = 'https' self.assertIs(req.is_secure(), True) - @override_settings(SECURE_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTOCOL', 'https')) + @override_settings(SECURE_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTO', 'https')) def test_xheader_preferred_to_underlying_request(self): class ProxyRequest(HttpRequest): def _get_scheme(self): @@ -387,7 +387,7 @@ class SecureProxySslHeaderTest(SimpleTestCase): # Client connects via HTTP. req = ProxyRequest() - req.META['HTTP_X_FORWARDED_PROTOCOL'] = 'http' + req.META['HTTP_X_FORWARDED_PROTO'] = 'http' self.assertIs(req.is_secure(), False) |