summaryrefslogtreecommitdiff
path: root/cherrypy/lib/cptools.py
diff options
context:
space:
mode:
authorJoseph Tate <jtate@dragonstrider.com>2014-03-06 16:23:42 -0500
committerJoseph Tate <jtate@dragonstrider.com>2014-03-06 16:23:42 -0500
commit4e58a670647973b82c872575bbffcdca444b0736 (patch)
tree9003e53d066b71fa34ea49c4b0ff4e52906c2bf9 /cherrypy/lib/cptools.py
parente816d091b24a4e2f38f77273926362d788871ea5 (diff)
downloadcherrypy-git-4e58a670647973b82c872575bbffcdca444b0736.tar.gz
Fix bug #1268, X-Forwarded-For IP order
Diffstat (limited to 'cherrypy/lib/cptools.py')
-rw-r--r--cherrypy/lib/cptools.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/cherrypy/lib/cptools.py b/cherrypy/lib/cptools.py
index 84b8fad0..134c8e47 100644
--- a/cherrypy/lib/cptools.py
+++ b/cherrypy/lib/cptools.py
@@ -209,9 +209,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