Compare commits

...

1 Commits

Author SHA1 Message Date
Geert Ijewski
d93762239c s/301/308 2020-01-05 18:08:00 +01:00
3 changed files with 6 additions and 6 deletions

View File

@@ -1150,7 +1150,7 @@ def _redirect_block_for_domain(domain):
updated_domain = '^' + updated_domain + '$'
redirect_block = [[
['\n ', 'if', ' ', '($host', ' ', match_symbol, ' ', '%s)' % updated_domain, ' '],
[['\n ', 'return', ' ', '301', ' ', 'https://$host$request_uri'],
[['\n ', 'return', ' ', '308', ' ', 'https://$host$request_uri'],
'\n ']],
['\n']]
return redirect_block

View File

@@ -557,7 +557,7 @@ class NginxConfiguratorTest(util.NginxTest):
[], []]],
[['server'], [
[['if', '($host', '=', 'www.example.com)'], [
['return', '301', 'https://$host$request_uri']]],
['return', '308', 'https://$host$request_uri']]],
['#', ' managed by Certbot'], [],
['listen', '69.50.225.155:9000'],
['listen', '127.0.0.1'],

View File

@@ -114,7 +114,7 @@ class VirtualHostTest(unittest.TestCase):
raw1 = [
['listen', '69.50.225.155:9000'],
[['if', '($scheme', '!=', '"https") '],
[['return', '301', 'https://$host$request_uri']]
[['return', '308', 'https://$host$request_uri']]
],
['#', ' managed by Certbot']
]
@@ -125,7 +125,7 @@ class VirtualHostTest(unittest.TestCase):
raw2 = [
['listen', '69.50.225.155:9000'],
[['if', '($scheme', '!=', '"https") '],
[['return', '301', 'https://$host$request_uri']]
[['return', '308', 'https://$host$request_uri']]
]
]
self.vhost2 = VirtualHost(
@@ -187,7 +187,7 @@ class VirtualHostTest(unittest.TestCase):
from certbot_nginx._internal.obj import Addr
from certbot_nginx._internal.configurator import _test_block_from_block
test_block = [
['\n ', 'return', ' ', '301', ' ', 'https://$host$request_uri'],
['\n ', 'return', ' ', '308', ' ', 'https://$host$request_uri'],
['\n']
]
test_needle = _test_block_from_block(test_block)
@@ -199,7 +199,7 @@ class VirtualHostTest(unittest.TestCase):
['#', ' managed by Certbot'],
['ssl_certificate_key', '/etc/letsencrypt/live/two.functorkitten.xyz/privkey.pem'],
['#', ' managed by Certbot'],
['return', '301', 'https://$host$request_uri'],
['return', '308', 'https://$host$request_uri'],
['#', ' managed by Certbot'], []]
vhost_haystack = VirtualHost(
"filp",