summaryrefslogtreecommitdiff
path: root/django/middleware
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2007-09-20 17:03:14 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2007-09-20 17:03:14 +0000
commit5ae6fafad7b2de9d5df042a6e07e41d746b4b59b (patch)
tree7affeab1ef56bb71768479bef428c62ee082ada0 /django/middleware
parent484189ff9ca4b682a113a6d8bfd76848a52b71f6 (diff)
Fixed #3872, which turns out to not have been a bug in the first place, by reverting [6364].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6397 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/middleware')
-rw-r--r--django/middleware/http.py7
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