We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bb4252 commit 0300f73Copy full SHA for 0300f73
notebook/notebookapp.py
@@ -860,7 +860,18 @@ def _default_allow_remote(self):
860
addr = info[4][0]
861
if not py3compat.PY3:
862
addr = addr.decode('ascii')
863
- if not ipaddress.ip_address(addr).is_loopback:
+
864
+ try:
865
+ parsed = ipaddress.ip_address(addr.split('%')[0])
866
+ except ValueError:
867
+ self.log.warning("Unrecognised IP address: %r", addr)
868
+ continue
869
870
+ # Macs map localhost to 'fe80::1%lo0', a link local address
871
+ # scoped to the loopback interface. For now, we'll assume that
872
+ # any scoped link-local address is effectively local.
873
+ if not (parsed.is_loopback
874
+ or (('%' in addr) and parsed.is_link_local)):
875
return True
876
return False
877
else:
0 commit comments