55class TestForceHttps (BaseConfigTest ):
66 @classmethod
77 def setup_class (cls ):
8- super (TestForceHttps , cls ).setup_class ('config_test.yaml' ,
9- custom_config = {'force_scheme' : 'https' })
8+ super (TestForceHttps , cls ).setup_class ('config_test.yaml' )
9+
10+ def test_force_https_replay_1 (self , fmod ):
11+ resp = self .get ('/pywb/20140128051539{0}/http://example.com/' , fmod ,
12+ headers = {'X-Forwarded-Proto' : 'https' })
13+
14+ assert '"https://localhost:80/pywb/20140128051539{0}/http://www.iana.org/domains/example"' .format (fmod ) in resp .text , resp .text
15+
16+
17+ # ============================================================================
18+ class TestForceHttpsConfig (BaseConfigTest ):
19+ @classmethod
20+ def setup_class (cls ):
21+ super (TestForceHttpsConfig , cls ).setup_class ('config_test.yaml' ,
22+ custom_config = {'force_scheme' : 'https' })
1023
1124 def test_force_https_replay_1 (self , fmod ):
1225 resp = self .get ('/pywb/20140128051539{0}/http://example.com/' , fmod )
@@ -18,11 +31,11 @@ def test_force_https_replay_1(self, fmod):
1831class TestForceHttpsRedirect (BaseConfigTest ):
1932 @classmethod
2033 def setup_class (cls ):
21- super (TestForceHttpsRedirect , cls ).setup_class ('config_test_redirect_classic.yaml' ,
22- custom_config = {'force_scheme' : 'https' })
34+ super (TestForceHttpsRedirect , cls ).setup_class ('config_test_redirect_classic.yaml' )
2335
2436 def test_force_https_redirect_replay_1 (self , fmod ):
25- resp = self .get ('/pywb/20140128051539{0}/http://example.com/' , fmod )
37+ resp = self .get ('/pywb/20140128051539{0}/http://example.com/' , fmod ,
38+ headers = {'X-Forwarded-Proto' : 'https' })
2639
2740 assert resp .headers ['Location' ] == 'https://localhost:80/pywb/20140127171251{0}/http://example.com' .format (fmod )
2841 resp = resp .follow ()
@@ -37,11 +50,11 @@ def test_force_https_redirect_replay_1(self, fmod):
3750class TestForceHttpsRoot (BaseConfigTest ):
3851 @classmethod
3952 def setup_class (cls ):
40- super (TestForceHttpsRoot , cls ).setup_class ('config_test_root_coll.yaml' ,
41- custom_config = {'force_scheme' : 'https' })
53+ super (TestForceHttpsRoot , cls ).setup_class ('config_test_root_coll.yaml' )
4254
4355 def test_force_https_root_replay_1 (self , fmod ):
44- resp = self .get ('/20140128051539{0}/http://www.iana.org/domains/example' , fmod )
56+ resp = self .get ('/20140128051539{0}/http://www.iana.org/domains/example' , fmod ,
57+ headers = {'X-Forwarded-Proto' : 'https' })
4558
4659 assert resp .headers ['Location' ] == 'https://localhost:80/20140128051539{0}/https://www.iana.org/domains/reserved' .format (fmod )
4760
0 commit comments