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

memcached cannot handle spaces in keys
This commit is contained in:
tuky 2014-02-12 18:11:18 +01:00
parent e56ba33d1b
commit d18d32669a

View File

@ -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,