Use normalpath() with base_path to avoid abort(404).
e.g: >>> op.normpath(directory).startswith(base_path) False >>> op.normpath(directory) u'/home/projects/mywebsite/static/utils' >>> base_path u'/home/projects/mywebsite/admin/../static' >>> base_path = op.normpath(base_path) >>> op.normpath(directory).startswith(base_path) True
Showing
Please register or sign in to comment