Merge pull request #4435 from minrk/tornado-tweaks

raise 404 on not found static file
This commit is contained in:
Min RK 2013-10-27 13:12:08 -07:00
commit 4e8bc066e9

View File

@ -327,8 +327,8 @@ class FileFindHandler(web.StaticFileHandler):
try: try:
abspath = os.path.abspath(filefind(path, roots)) abspath = os.path.abspath(filefind(path, roots))
except IOError: except IOError:
# empty string should always give exists=False # IOError means not found
return '' raise web.HTTPError(404)
cls._static_paths[path] = abspath cls._static_paths[path] = abspath
return abspath return abspath