mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
raise 404 on not found static file
master gives 403 due to empty string being outside of root
This commit is contained in:
parent
daf15735bd
commit
ff744e25cd
@ -321,8 +321,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
|
||||||
|
Loading…
Reference in New Issue
Block a user