mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
use ContentManagers own is_hidden() function
This commit is contained in:
parent
28d4444def
commit
fc59a1b927
@ -22,7 +22,6 @@ try:
|
||||
except ImportError:
|
||||
app_log = logging.getLogger()
|
||||
|
||||
from IPython.html.utils import is_hidden
|
||||
from IPython.html.base.handlers import IPythonHandler
|
||||
|
||||
class FilesHandler(IPythonHandler):
|
||||
@ -32,7 +31,7 @@ class FilesHandler(IPythonHandler):
|
||||
def get(self, path):
|
||||
cm = self.settings['contents_manager']
|
||||
abs_path = os.path.join(cm.root_dir, path)
|
||||
if is_hidden(abs_path):
|
||||
if cm.is_hidden(abs_path):
|
||||
self.log.info("Refusing to serve hidden file, via 404 Error")
|
||||
raise web.HTTPError(404)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user