summaryrefslogtreecommitdiff
path: root/cherrypy/lib/cptools.py
diff options
context:
space:
mode:
authorJoseph Tate <jtate@dragonstrider.com>2014-03-06 16:27:16 -0500
committerJoseph Tate <jtate@dragonstrider.com>2014-03-06 16:27:16 -0500
commite2677c484ef866157e1f953d138d9f58c8b7b376 (patch)
treed60747e4ce04e25929a4000ae02e7041495a9b68 /cherrypy/lib/cptools.py
parent3c141af42e4eb9225264f4e1080bea3b21f8e295 (diff)
downloadcherrypy-git-e2677c484ef866157e1f953d138d9f58c8b7b376.tar.gz
Fix bug #1268, X-Forwarded-For IP order
--HG-- branch : cherrypy-3.2.x
Diffstat (limited to 'cherrypy/lib/cptools.py')
-rw-r--r--cherrypy/lib/cptools.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cherrypy/lib/cptools.py b/cherrypy/lib/cptools.py
index 5ae40b02..3fbfb62b 100644
--- a/cherrypy/lib/cptools.py
+++ b/cherrypy/lib/cptools.py
@@ -207,8 +207,8 @@ def proxy(base=None, local='X-Forwarded-Host', remote='X-Forwarded-For',
cherrypy.log('Testing remote %r:%r' % (remote, xff), 'TOOLS.PROXY')
if xff:
if remote == 'X-Forwarded-For':
- # See http://bob.pythonmac.org/archives/2005/09/23/apache-x-forwarded-for-caveat/
- xff = xff.split(',')[-1].strip()
+ #Bug #1268
+ xff = xff.split(',')[0].strip()
request.remote.ip = xff