Skip to content

Proxy tools causes double port, creating broken links #1627

Closed
@jaraco

Description

@jaraco

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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions