5
5
class TestForceHttps (BaseConfigTest ):
6
6
@classmethod
7
7
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' })
10
23
11
24
def test_force_https_replay_1 (self , fmod ):
12
25
resp = self .get ('/pywb/20140128051539{0}/http://example.com/' , fmod )
@@ -18,11 +31,11 @@ def test_force_https_replay_1(self, fmod):
18
31
class TestForceHttpsRedirect (BaseConfigTest ):
19
32
@classmethod
20
33
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' )
23
35
24
36
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' })
26
39
27
40
assert resp .headers ['Location' ] == 'https://localhost:80/pywb/20140127171251{0}/http://example.com' .format (fmod )
28
41
resp = resp .follow ()
@@ -37,11 +50,11 @@ def test_force_https_redirect_replay_1(self, fmod):
37
50
class TestForceHttpsRoot (BaseConfigTest ):
38
51
@classmethod
39
52
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' )
42
54
43
55
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' })
45
58
46
59
assert resp .headers ['Location' ] == 'https://localhost:80/20140128051539{0}/https://www.iana.org/domains/reserved' .format (fmod )
47
60
0 commit comments