fix: [IPAdress] remove leading zeros #465

pull/486/head
Terrtia 2020-02-10 10:44:06 +01:00
parent f9856a1589
commit cf24c59e1d
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 3 additions and 2 deletions

View File

@ -32,8 +32,9 @@ def search_ip(message):
results = reg_ip.findall(content)
matching_ips = []
for res in results:
address = IPv4Address(res)
for ip in results:
ip = '.'.join([str(int(x)) for x in ip.split('.')])
address = IPv4Address(ip)
for network in ip_networks:
if address in network:
matching_ips.append(address)