Esempio n. 1
0
 def test_set_without_xheader(self):
     self.settings_module.SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
     req = HttpRequest()
     self.assertEqual(req.is_secure(), False)
Esempio n. 2
0
 def test_set_with_xheader_right(self):
     self.settings_module.SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
     req = HttpRequest()
     req.META['HTTP_X_FORWARDED_PROTOCOL'] = 'https'
     self.assertEqual(req.is_secure(), True)
Esempio n. 3
0
 def test_none(self):
     self.settings_module.SECURE_PROXY_SSL_HEADER = None
     req = HttpRequest()
     self.assertEqual(req.is_secure(), False)