Commit d18d3266 by tuky

remove spaces from META['HTTP_X_FORWARDED_FOR'] as throttle key

memcached cannot handle spaces in keys
parent e56ba33d
......@@ -155,6 +155,8 @@ class AnonRateThrottle(SimpleRateThrottle):
ident = request.META.get('HTTP_X_FORWARDED_FOR')
if ident is None:
ident = request.META.get('REMOTE_ADDR')
else:
ident = u''.join(ident.split())
return self.cache_format % {
'scope': self.scope,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment