Make sure cherrypy doesn't add the local port twice with http_proxy enabled

This commit is contained in:
JonnyWong16 2016-05-19 21:54:58 -07:00
parent a3f0a78df0
commit f4c9dc8a5f

View file

@ -195,7 +195,7 @@ def proxy(base=None, local='X-Forwarded-Host', remote='X-Forwarded-For',
if not base:
base = request.headers.get('Host', '127.0.0.1')
port = request.local.port
if port != 80:
if port != 80 and not base.endswith(':%s' % port):
base += ':%s' % port
if base.find("://") == -1: