mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
Add details to exception to see where we're going wrong
This commit is contained in:
parent
a5a5d1c6d3
commit
27cf0e70a3
@ -44,8 +44,7 @@ class StaticHandler(object):
|
|||||||
try:
|
try:
|
||||||
validate_requested_file_path(static_path_to_validate, url)
|
validate_requested_file_path(static_path_to_validate, url)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise NotFoundException('Static File Not Found: ' +
|
raise NotFoundException(f'Static File {url_str} (simplified: {url}) not found in {static_path_to_validate}')
|
||||||
url_str)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = self.block_loader.load(full_path)
|
data = self.block_loader.load(full_path)
|
||||||
@ -81,7 +80,7 @@ class StaticHandler(object):
|
|||||||
url_str)
|
url_str)
|
||||||
|
|
||||||
def validate_requested_file_path(self, static_dir, requested_path):
|
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
|
Returns relative path starting from static_dir or raises ValueError if
|
||||||
requested path is not in the static directory.
|
requested path is not in the static directory.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user