Exlude IPv6 addresses until now

This commit is contained in:
Alexandre Dulaunoy 2015-01-10 20:43:14 +01:00
parent 9aa4329918
commit 7d9f1ca0b8

View file

@ -11,6 +11,7 @@ import redis
import sys import sys
import netaddr import netaddr
import json import json
import re
import tornado.httpserver import tornado.httpserver
import tornado.ioloop import tornado.ioloop
@ -33,6 +34,11 @@ class SSLQueryHandler(tornado.web.RequestHandler):
subnets = [input] subnets = [input]
out = {} out = {}
for subnet in subnets: for subnet in subnets:
if re.findall(r":", subnet):
self.clear()
self.set_status(400)
self.finish('IPv6 is not (yet) supported')
continue
try: try:
iplist = netaddr.IPNetwork(subnet) iplist = netaddr.IPNetwork(subnet)
except: except: