prefer the url's scheme over the kwarg

tabs -> spaces
add test
add changelog
This commit is contained in:
David Lord 2017-07-29 13:03:08 -07:00
parent 241673fd15
commit a89bdb3395
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 17 additions and 4 deletions

View file

@ -40,12 +40,14 @@ def make_test_environ_builder(
if subdomain:
http_host = '{0}.{1}'.format(subdomain, http_host)
url = url_parse(path)
if url_scheme is None:
url_scheme = url.scheme or app.config['PREFERRED_URL_SCHEME']
url_scheme = app.config['PREFERRED_URL_SCHEME']
base_url = '{0}://{1}/{2}'.format(
url_scheme, url.netloc or http_host, app_root.lstrip('/')
url = url_parse(path)
base_url = '{scheme}://{netloc}/{path}'.format(
scheme=url.scheme or url_scheme,
netloc=url.netloc or http_host,
path=app_root.lstrip('/')
)
path = url.path