forked from orbit-oss/flask
prefer the url's scheme over the kwarg
tabs -> spaces add test add changelog
This commit is contained in:
parent
241673fd15
commit
a89bdb3395
3 changed files with 17 additions and 4 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue