mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-29 13:04:03 +03:00
Merge pull request #1409 from tuky/patch-1
remove spaces from META['HTTP_X_FORWARDED_FOR'] as throttle key
This commit is contained in:
commit
5333a93126
|
@ -157,6 +157,8 @@ class AnonRateThrottle(SimpleRateThrottle):
|
||||||
ident = request.META.get('HTTP_X_FORWARDED_FOR')
|
ident = request.META.get('HTTP_X_FORWARDED_FOR')
|
||||||
if ident is None:
|
if ident is None:
|
||||||
ident = request.META.get('REMOTE_ADDR')
|
ident = request.META.get('REMOTE_ADDR')
|
||||||
|
else:
|
||||||
|
ident = ''.join(ident.split())
|
||||||
|
|
||||||
return self.cache_format % {
|
return self.cache_format % {
|
||||||
'scope': self.scope,
|
'scope': self.scope,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user