Fix default value method for allow_remote_access when ip is '*'

This commit is contained in:
Dave Foster 2018-10-25 09:36:01 -04:00
parent 04a686dbaf
commit 1c40db2440

View File

@ -865,6 +865,12 @@ class NotebookApp(JupyterApp):
@default('allow_remote_access')
def _default_allow_remote(self):
"""Disallow remote access if we're listening only on loopback addresses"""
# if blank, self.ip was configured to "*" meaning bind to all interfaces,
# see _valdate_ip
if self.ip == "":
return True
try:
addr = ipaddress.ip_address(self.ip)
except ValueError: