From 603e14abeb031dd3b3075811dd0840148bde34a2 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Tue, 27 Mar 2012 14:42:19 -0700 Subject: [PATCH] Make ip_and_slash16 resilient to bizarre extra spaces. --- r2/r2/lib/utils/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/r2/r2/lib/utils/utils.py b/r2/r2/lib/utils/utils.py index 4730610d0..4f29e5e9f 100644 --- a/r2/r2/lib/utils/utils.py +++ b/r2/r2/lib/utils/utils.py @@ -1127,6 +1127,7 @@ def ip_and_slash16(req): if ip is None: raise ValueError("request.ip is None") + ip = ip.strip() m = r_subnet.match(ip) if m is None: