mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
Fix default value method for allow_remote_access
when ip is '*'
This commit is contained in:
parent
04a686dbaf
commit
1c40db2440
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user