diff options
| author | Joseph Kocherhans <joseph@jkocherhans.com> | 2007-09-25 00:08:38 +0000 |
|---|---|---|
| committer | Joseph Kocherhans <joseph@jkocherhans.com> | 2007-09-25 00:08:38 +0000 |
| commit | 609eaf130d2d9eac109aefa59bfced32b67b9eb1 (patch) | |
| tree | b8bf4fd18c0fe75a418525baefa485c5ce31ce2f /django/middleware/http.py | |
| parent | afb8f0a61969dff6450cd296be5eac2a5693ecd9 (diff) | |
newforms-admin: Merged to [6416]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6417 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/middleware/http.py')
| -rw-r--r-- | django/middleware/http.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/django/middleware/http.py b/django/middleware/http.py index 78e066c67b..71cdf7aa5d 100644 --- a/django/middleware/http.py +++ b/django/middleware/http.py @@ -54,8 +54,7 @@ class SetRemoteAddrFromForwardedFor(object): except KeyError: return None else: - # HTTP_X_FORWARDED_FOR can be a comma-separated list of IPs. - # Take just the last one. - # See http://bob.pythonmac.org/archives/2005/09/23/apache-x-forwarded-for-caveat/ - real_ip = real_ip.split(",")[-1].strip() + # HTTP_X_FORWARDED_FOR can be a comma-separated list of IPs. The + # client's IP will be the first one. + real_ip = real_ip.split(",")[0].strip() request.META['REMOTE_ADDR'] = real_ip |
