mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Added check for /files/
This commit is contained in:
parent
51191c2ea5
commit
14f3710250
2 changed files with 8 additions and 2 deletions
|
|
@ -1806,9 +1806,14 @@ def get_file_path(vhost_path):
|
|||
"""
|
||||
# Strip off /files/
|
||||
try:
|
||||
avail_fp = vhost_path[7:].split("/")
|
||||
except TypeError:
|
||||
if vhost_path.startswith("/files/"):
|
||||
avail_fp = vhost_path[7:].split("/")
|
||||
else:
|
||||
return None
|
||||
except AttributeError:
|
||||
# If we recieved a None path
|
||||
return None
|
||||
|
||||
last_good = ""
|
||||
# Loop through the path parts and validate after every addition
|
||||
for p in avail_fp:
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ class MultipleVhostsTest(util.ApacheTest):
|
|||
def test_get_bad_path(self):
|
||||
from certbot_apache.configurator import get_file_path
|
||||
self.assertEqual(get_file_path(None), None)
|
||||
self.assertEqual(get_file_path("nonexistent"), None)
|
||||
self.assertEqual(self.config._create_vhost("nonexistent"), None) # pylint: disable=protected-access
|
||||
|
||||
def test_bad_servername_alias(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue