mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 00:00:44 +02:00
Add RewriteEngine on directive also in post (#10232)
Fixes https://github.com/certbot/certbot/issues/9835#issuecomment-2717096178, where our `RewriteEngine on` directive inserted at the beginning of a virtualhost was overridden a `RewriteEngine Off` directive later. This PR does the easy thing of placing `RewriteEngine on` in our post-insert.
This commit is contained in:
@@ -24,10 +24,10 @@ class ApacheHttp01(common.ChallengePerformer):
|
||||
"""Class that performs HTTP-01 challenges within the Apache configurator."""
|
||||
|
||||
CONFIG_TEMPLATE24_PRE = """\
|
||||
RewriteEngine on
|
||||
RewriteRule ^/\\.well-known/acme-challenge/([A-Za-z0-9-_=]+)$ {0}/$1 [END]
|
||||
"""
|
||||
CONFIG_TEMPLATE24_POST = """\
|
||||
RewriteEngine on
|
||||
<Directory {0}>
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
@@ -209,7 +209,7 @@ class ApacheHttp01Test(util.ApacheTest):
|
||||
with open(self.http.challenge_conf_post) as f:
|
||||
post_conf_contents = f.read()
|
||||
|
||||
assert "RewriteEngine on" in pre_conf_contents
|
||||
assert "RewriteEngine on" in post_conf_contents
|
||||
assert "RewriteRule" in pre_conf_contents
|
||||
|
||||
assert self.http.challenge_dir in post_conf_contents
|
||||
|
||||
Reference in New Issue
Block a user