Skip to content

Commit

Permalink
Merge pull request #4139 from daf/fix-allow-remote-access-with-all-ips
Browse files Browse the repository at this point in the history
Fix default value method for `allow_remote_access` when ip is '*'
  • Loading branch information
takluyver authored Nov 7, 2018
2 parents 04a686d + 1c40db2 commit a7033b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,12 @@ def _token_changed(self, change):
@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:
Expand Down

0 comments on commit a7033b8

Please sign in to comment.