New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy tools causes double port, creating broken links #1627

Closed
jaraco opened this Issue Aug 29, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@jaraco
Member

jaraco commented Aug 29, 2017

Consider this script:

__requires__ = ['cherrypy']

import os

import cherrypy


class Server:
	@cherrypy.expose
	def index(self):
		return cherrypy.url('/foo/')

	@classmethod
	def run(cls):
		config = {
			'global': {
				'server.socket_port': int(os.environ.get('PORT', 8080)),
				'tools.proxy.on': True,
			},
		}
		cherrypy.quickstart(cls(), config=config)


__name__ == '__main__' and Server.run()

Run it and request / and you'll get:

$ curl http://localhost:8080/
http://localhost:8080:8080/foo/

jaraco added a commit that referenced this issue Aug 29, 2017

In proxy tool, more simply rely on the existing request.base if no Ho…
…st header exists and no base was indicated. Avoid adding an extra port indicator. Fixes #1627.

jaraco added a commit that referenced this issue Aug 29, 2017

In proxy tool, more simply rely on the existing request.base if no Ho…
…st header exists and no base was indicated. Avoid adding an extra port indicator. Fixes #1627.

@jaraco jaraco closed this in #1628 Aug 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment