From fd0e9e865cf9f4b3f2dfe0213404fb0747682ffd Mon Sep 17 00:00:00 2001 From: MinRK Date: Wed, 18 Dec 2013 14:18:09 -0800 Subject: [PATCH] don't raise 404 in get_absolute_path raise in validate_absolute_path, where it belongs --- IPython/html/base/handlers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IPython/html/base/handlers.py b/IPython/html/base/handlers.py index 5ab16b9aa..0170012a7 100644 --- a/IPython/html/base/handlers.py +++ b/IPython/html/base/handlers.py @@ -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