use absolute path in static root

This commit is contained in:
Raphael Deem 2017-04-16 21:58:10 -07:00
parent f6d4a06661
commit 3e87314adf

View File

@ -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)