Fix wrong position of parentheses, add unit tests
This commit is contained in:
1 parent
757dfcf5c7
commit
169275b052
2 files changed
+3
-1
No files matched your search
@@ -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:"):]
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in new issue
Block a user