コード例 #1
0
ファイル: tests.py プロジェクト: timothyclemans/djangocg
 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)
コード例 #2
0
ファイル: tests.py プロジェクト: timothyclemans/djangocg
 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)
コード例 #3
0
ファイル: tests.py プロジェクト: timothyclemans/djangocg
 def test_none(self):
     self.settings_module.SECURE_PROXY_SSL_HEADER = None
     req = HttpRequest()
     self.assertEqual(req.is_secure(), False)