|
|
|
|
@ -330,13 +330,16 @@ class FileFindHandler(web.StaticFileHandler):
|
|
|
|
|
abspath = os.path.abspath(filefind(path, roots))
|
|
|
|
|
except IOError:
|
|
|
|
|
# IOError means not found
|
|
|
|
|
raise web.HTTPError(404)
|
|
|
|
|
return ''
|
|
|
|
|
|
|
|
|
|
cls._static_paths[path] = abspath
|
|
|
|
|
return abspath
|
|
|
|
|
|
|
|
|
|
def validate_absolute_path(self, root, absolute_path):
|
|
|
|
|
"""check if the file should be served (raises 404, 403, etc.)"""
|
|
|
|
|
if absolute_path == '':
|
|
|
|
|
raise web.HTTPError(404)
|
|
|
|
|
|
|
|
|
|
for root in self.root:
|
|
|
|
|
if (absolute_path + os.sep).startswith(root):
|
|
|
|
|
break
|
|
|
|
|
|