Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #3872, which turns out to not have been a bug in the first plac…

…e, by reverting [6364].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6397 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5ae6fafad7b2de9d5df042a6e07e41d746b4b59b 1 parent 484189f
@jacobian jacobian authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 django/middleware/http.py
View
7 django/middleware/http.py
@@ -54,8 +54,7 @@ def process_request(self, request):
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

0 comments on commit 5ae6faf

Please sign in to comment.
Something went wrong with that request. Please try again.