Changeset 6364
- Timestamp:
- 09/16/07 11:54:16 (1 year ago)
- Files:
-
- django/trunk/django/middleware/http.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/middleware/http.py
r5712 r6364 56 56 else: 57 57 # HTTP_X_FORWARDED_FOR can be a comma-separated list of IPs. 58 # Take just the first one. 59 real_ip = real_ip.split(",")[0] 58 # Take just the last one. 59 # See http://bob.pythonmac.org/archives/2005/09/23/apache-x-forwarded-for-caveat/ 60 real_ip = real_ip.split(",")[-1].strip() 60 61 request.META['REMOTE_ADDR'] = real_ip
