reverting 2c364c2079 which incorrecly assumes the scheme can only be http or https

This commit is contained in:
mdipierro
2019-08-11 10:58:22 -07:00
parent 60c68164f3
commit 019295e1d1
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -204,7 +204,7 @@ def url_out(request, environ, application, controller, function,
if host is True or (host is None and (scheme or port is not None)):
host = request.env.http_host
if not scheme or scheme is True:
scheme = 'https' if request and request.is_https else 'http'
scheme = request.env.get('wsgi_url_scheme', 'http').lower() if request else 'http'
if host:
host_port = host if not port else host.split(':', 1)[0] + ':%s' % port
url = '%s://%s%s' % (scheme, host_port, url)