make_test_environ_builder: use url_scheme from path if provided
When providing https url in path ("https://example.com/")
we hope that we will get https scheme in environment
This commit is contained in:
parent
851eaa4db7
commit
241673fd15
1 changed files with 2 additions and 2 deletions
|
|
@ -40,10 +40,10 @@ def make_test_environ_builder(
|
||||||
if subdomain:
|
if subdomain:
|
||||||
http_host = '{0}.{1}'.format(subdomain, http_host)
|
http_host = '{0}.{1}'.format(subdomain, http_host)
|
||||||
|
|
||||||
|
url = url_parse(path)
|
||||||
if url_scheme is None:
|
if url_scheme is None:
|
||||||
url_scheme = app.config['PREFERRED_URL_SCHEME']
|
url_scheme = url.scheme or app.config['PREFERRED_URL_SCHEME']
|
||||||
|
|
||||||
url = url_parse(path)
|
|
||||||
base_url = '{0}://{1}/{2}'.format(
|
base_url = '{0}://{1}/{2}'.format(
|
||||||
url_scheme, url.netloc or http_host, app_root.lstrip('/')
|
url_scheme, url.netloc or http_host, app_root.lstrip('/')
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue