Merge pull request #647 from r0fls/645
use absolute path in static root
This commit is contained in:
commit
7e9b65feca
|
@ -56,7 +56,7 @@ def register(app, uri, file_or_directory, pattern,
|
||||||
# URL decode the path sent by the browser otherwise we won't be able to
|
# URL decode the path sent by the browser otherwise we won't be able to
|
||||||
# match filenames which got encoded (filenames with spaces etc)
|
# match filenames which got encoded (filenames with spaces etc)
|
||||||
file_path = path.abspath(unquote(file_path))
|
file_path = path.abspath(unquote(file_path))
|
||||||
if not file_path.startswith(root_path):
|
if not file_path.startswith(path.abspath(unquote(root_path))):
|
||||||
raise FileNotFound('File not found',
|
raise FileNotFound('File not found',
|
||||||
path=file_or_directory,
|
path=file_or_directory,
|
||||||
relative_url=file_uri)
|
relative_url=file_uri)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user