1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

Use abspath for static dirs

This commit is contained in:
Tessa Walsh 2024-11-05 11:20:14 -05:00
parent fe2403f8b5
commit 839694f70f

View File

@ -32,13 +32,13 @@ class StaticHandler(object):
full_path = environ.get('pywb.static_dir') full_path = environ.get('pywb.static_dir')
if full_path: if full_path:
static_path_to_validate = full_path static_path_to_validate = os.path.abspath(full_path)
full_path = os.path.join(full_path, url) full_path = os.path.join(full_path, url)
if not os.path.isfile(full_path): if not os.path.isfile(full_path):
full_path = None full_path = None
if not full_path: if not full_path:
static_path_to_validate = self.static_path static_path_to_validate = os.path.abspath(self.static_path)
full_path = os.path.join(self.static_path, url) full_path = os.path.join(self.static_path, url)
try: try: