use localhost as default local hostname

so this list isn't empty when these handlers are used outside NotebookApp
This commit is contained in:
Min RK 2018-07-31 14:02:12 +02:00
parent 1901eeac63
commit e33a16f42f

View File

@ -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