mirror of
https://github.com/certbot/certbot.git
synced 2026-06-04 06:15:36 -04:00
Support quoted server names in Nginx (#5811)
* Support quoted server names in Nginx * add unit test to check that we strip quotes * update configurator test
This commit is contained in:
parent
f5ad08047b
commit
bdaccb645b
3 changed files with 3 additions and 3 deletions
|
|
@ -743,7 +743,7 @@ def _parse_server_raw(server):
|
|||
if addr.ssl:
|
||||
parsed_server['ssl'] = True
|
||||
elif directive[0] == 'server_name':
|
||||
parsed_server['names'].update(directive[1:])
|
||||
parsed_server['names'].update(x.strip('"\'') for x in directive[1:])
|
||||
elif _is_ssl_on_directive(directive):
|
||||
parsed_server['ssl'] = True
|
||||
apply_ssl_to_all_addrs = True
|
||||
|
|
|
|||
|
|
@ -639,7 +639,7 @@ class NginxConfiguratorTest(util.NginxTest):
|
|||
self.assertEqual([[['server'],
|
||||
[['listen', 'myhost', 'default_server'],
|
||||
['listen', 'otherhost', 'default_server'],
|
||||
['server_name', 'www.example.org'],
|
||||
['server_name', '"www.example.org"'],
|
||||
[['location', '/'],
|
||||
[['root', 'html'],
|
||||
['index', 'index.html', 'index.htm']]]]],
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
server {
|
||||
listen myhost default_server;
|
||||
listen otherhost default_server;
|
||||
server_name www.example.org;
|
||||
server_name "www.example.org";
|
||||
|
||||
location / {
|
||||
root html;
|
||||
|
|
|
|||
Loading…
Reference in a new issue