diff --git a/confluent_server/confluent/httpapi.py b/confluent_server/confluent/httpapi.py index 2feac493..4aed9292 100644 --- a/confluent_server/confluent/httpapi.py +++ b/confluent_server/confluent/httpapi.py @@ -469,6 +469,10 @@ def resourcehandler_backend(env, start_response): funport = forwarder.get_port(targip, env['HTTP_X_FORWARDED_FOR'], authorized['sessionid']) host = env['HTTP_X_FORWARDED_HOST'] + if ']' in host: + host = host.split(']')[0] + ']' + elif ':' in host: + host = host.rsplit(':', 1)[0] url = 'https://{0}:{1}/'.format(host, funport) start_response('302', [('Location', url)]) yield 'Our princess is in another castle!'