1. cherrypy
  2. CherryPy
Issue #1042 resolved

minor bugfix: cherrypy proxy() buggy over multiple proxy

Anonymous created an issue

In case of cherrypy over multiple http proxies, the X-Forwarded-Host can contain multiple hostnames, separated by ", " . The proxy() function is lib/tools.py doesn't handles this case, which leads to multiple problems in the higher level code. (By fact, nearly killed an openerp project)

I traced it, and here is a patch: (for cherrypy3.1.2)

{{{

--- lib/cptools.py.orig 2009-04-13 07:38:03.000000000 +0200 +++ lib/cptools.py 2011-01-02 23:50:12.227432468 +0100 @@ -133,6 +133,8 @@

 if local:
     base = request.headers.get(local, base)
  • if ", " in base:
  • base = base.split(", ")[0] if not base: port = cherrypy.request.local.port if port == 80:

}}}

Please fix it soon, a such low-level problem harms a lot to the people. Thanks.

Reported by horvath.akos.peter@gmail.com

Comments (4)

  1. Log in to comment