1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-24 19:22:07 +03:00

Dequote possible quoted target

This commit is contained in:
sagi
2016-01-11 19:48:17 +00:00
parent ae572fe084
commit 82a58fec48

View File

@@ -716,6 +716,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
rewrite_rule = "RewriteRule"
if line.lstrip()[:len(rewrite_rule)] != rewrite_rule:
return False
# line starts with RewriteRule.
# According to: http://httpd.apache.org/docs/2.4/rewrite/flags.html
@@ -723,6 +724,10 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
# RewriteRule pattern target [Flag1,Flag2,Flag3]
# i.e. target is required, so it must exist.
target = line.split()[2].strip()
# target may be surrounded with double quotes
if len(target) > 0 and target[0]==target[-1]=="\""
target = target[1:-1]
https_prefix = "https://"
if len(target) < len(https_prefix):