diff options
| -rw-r--r-- | rest_framework/throttling.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rest_framework/throttling.py b/rest_framework/throttling.py index 8943f22c..a946d837 100644 --- a/rest_framework/throttling.py +++ b/rest_framework/throttling.py @@ -152,7 +152,9 @@ class AnonRateThrottle(SimpleRateThrottle): if request.user.is_authenticated(): return None # Only throttle unauthenticated requests. - ident = request.META.get('REMOTE_ADDR', None) + ident = request.META.get('HTTP_X_FORWARDED_FOR') + if ident is None: + ident = request.META.get('REMOTE_ADDR') return self.cache_format % { 'scope': self.scope, |
