mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -54,8 +54,7 @@ class SetRemoteAddrFromForwardedFor(object): | |||||||
|         except KeyError: |         except KeyError: | ||||||
|             return None |             return None | ||||||
|         else: |         else: | ||||||
|             # HTTP_X_FORWARDED_FOR can be a comma-separated list of IPs. |             # HTTP_X_FORWARDED_FOR can be a comma-separated list of IPs. The | ||||||
|             # Take just the last one. |             # client's IP will be the first one. | ||||||
|             # See http://bob.pythonmac.org/archives/2005/09/23/apache-x-forwarded-for-caveat/ |             real_ip = real_ip.split(",")[0].strip() | ||||||
|             real_ip = real_ip.split(",")[-1].strip() |  | ||||||
|             request.META['REMOTE_ADDR'] = real_ip |             request.META['REMOTE_ADDR'] = real_ip | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user