From 129cf80f5e9e9cce10855c9e5ee53fc5fe929a1b Mon Sep 17 00:00:00 2001 From: kahnjw Date: Mon, 11 Nov 2013 16:36:19 -0800 Subject: [PATCH] Add source documentation. --- rest_framework/throttling.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rest_framework/throttling.py b/rest_framework/throttling.py index 1c8c6941d..982ca73d9 100644 --- a/rest_framework/throttling.py +++ b/rest_framework/throttling.py @@ -19,6 +19,10 @@ class BaseThrottle(object): raise NotImplementedError('.allow_request() must be overridden') def get_ident(self, request): + """ + Identify the machine making the request using HTTP_X_FORWARDED_FOR if + present, if not use REMOTE_ADDR. + """ if 'HTTP_X_FORWARDED_FOR' in request.META: xff = request.META.get('HTTP_X_FORWARDED_FOR') num_proxies = api_settings.NUM_PROXIES