From e33a16f42f7c864ac97cd0d010ac37ba6fc7be22 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 31 Jul 2018 14:02:12 +0200 Subject: [PATCH] use localhost as default local hostname so this list isn't empty when these handlers are used outside NotebookApp --- notebook/base/handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/base/handlers.py b/notebook/base/handlers.py index 278b3b428..582731639 100755 --- a/notebook/base/handlers.py +++ b/notebook/base/handlers.py @@ -435,7 +435,7 @@ class IPythonHandler(AuthenticatedHandler): addr = ipaddress.ip_address(host) except ValueError: # Not an IP address: check against hostnames - allow = host in self.settings.get('local_hostnames', []) + allow = host in self.settings.get('local_hostnames', ['localhost']) else: allow = addr.is_loopback