summaryrefslogtreecommitdiff
path: root/cherrypy/lib/cptools.py
diff options
context:
space:
mode:
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