Fix wrong position of parentheses, add unit tests

This commit is contained in:
Gina Häußge committed 2018-10-19 16:39:18 +02:00
1 parent 757dfcf5c7
commit 169275b052
2 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ else:
HAS_V6 = False
def is_lan_address(address, additional_private=None):
if address.lower().startswith("::ffff:" and "." in address):
if address.lower().startswith("::ffff:") and "." in address:
# ipv6 mapped ipv4 address, unmap
address = address[len("::ffff:"):]
+2
View File
@@ -38,6 +38,8 @@ class UtilNetTest(unittest.TestCase):
("10.1.2.3", [], True),
("fc00::1", [], True),
("::1", [], True),
("::ffff:192.168.1.1", [], True),
("::ffff:8.8.8.8", [], False),
("11.1.2.3", [], False),
("11.1.2.3", ["11/8"], True),
("12.1.1.123", [], True),