diff --git a/pastey/common.py b/pastey/common.py index 3c65137..5c1130e 100644 --- a/pastey/common.py +++ b/pastey/common.py @@ -15,7 +15,7 @@ def verify_whitelist(ip): # Check blacklist for network in config.blacklist_cidr: - if address in ipaddress.IPv4Network(network): + if address in ipaddress.ip_network(network): return False if not config.use_whitelist: @@ -23,7 +23,7 @@ def verify_whitelist(ip): # Check whitelist for network in config.whitelist_cidr: - if address in ipaddress.IPv4Network(network): + if address in ipaddress.ip_network(network): return True return False @@ -106,4 +106,4 @@ def build_url(request, path="/"): else: protocol = request.url.split('//')[0] if not config.force_https_links else "https:" - return protocol + "//" + domain + path \ No newline at end of file + return protocol + "//" + domain + path