aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/throttling.py
diff options
context:
space:
mode:
authorXavier Ordoquy2014-04-30 21:38:21 +0200
committerXavier Ordoquy2014-04-30 21:38:21 +0200
commit5333a9312613cffa573b4b38acfaa8d402286174 (patch)
tree6d4b37aee96d8a3f897bceceac2a9ba13fb8271c /rest_framework/throttling.py
parentd8fb81ceb15afe09a50584afcc466de812d30046 (diff)
parent5e4336845fed97a819e69669ed7aa3b9bf443edb (diff)
downloaddjango-rest-framework-5333a9312613cffa573b4b38acfaa8d402286174.tar.bz2
Merge pull request #1409 from tuky/patch-1
remove spaces from META['HTTP_X_FORWARDED_FOR'] as throttle key
Diffstat (limited to 'rest_framework/throttling.py')
-rw-r--r--rest_framework/throttling.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/rest_framework/throttling.py b/rest_framework/throttling.py
index efa9fb94..91be9cfd 100644
--- a/rest_framework/throttling.py
+++ b/rest_framework/throttling.py
@@ -157,6 +157,8 @@ class AnonRateThrottle(SimpleRateThrottle):
ident = request.META.get('HTTP_X_FORWARDED_FOR')
if ident is None:
ident = request.META.get('REMOTE_ADDR')
+ else:
+ ident = ''.join(ident.split())
return self.cache_format % {
'scope': self.scope,