From 27cf0e70a319e3eefeeef3ff15f5fd0ab0c85f1f Mon Sep 17 00:00:00 2001 From: Tessa Walsh Date: Tue, 5 Nov 2024 11:49:42 -0500 Subject: [PATCH] Add details to exception to see where we're going wrong --- pywb/apps/static_handler.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pywb/apps/static_handler.py b/pywb/apps/static_handler.py index 1bb0b632..913240b7 100644 --- a/pywb/apps/static_handler.py +++ b/pywb/apps/static_handler.py @@ -44,8 +44,7 @@ def __call__(self, environ, url_str): try: validate_requested_file_path(static_path_to_validate, url) except ValueError: - raise NotFoundException('Static File Not Found: ' + - url_str) + raise NotFoundException(f'Static File {url_str} (simplified: {url}) not found in {static_path_to_validate}') try: data = self.block_loader.load(full_path) @@ -81,7 +80,7 @@ def __call__(self, environ, url_str): url_str) def validate_requested_file_path(self, static_dir, requested_path): - """Validate that requested file path is within static dir. + """Validate that requested relative file path is within static dir. Returns relative path starting from static_dir or raises ValueError if requested path is not in the static directory.