Skip to content
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
Closed

Proxy tools causes double port, creating broken links #1627

jaraco opened this issue Aug 29, 2017 · 0 comments

Comments

@jaraco
Copy link
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
…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
…st header exists and no base was indicated. Avoid adding an extra port indicator. Fixes #1627.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant