Skip to content
Myr

make_test_environ_builder: use url_scheme from path if provided

Before adoption: this commit came in with the history the project adopted, so no landing records it.

When providing https url in path ("https://example.com/") we hope that we will get https scheme in environment

authored by Igor Kasianov · committed by Igor Kasianov · parent 851eaa4 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:flask/testing.py+2 added-2 removed
38 unmodified lines
3940 if subdomain:41 http_host = '{0}.{1}'.format(subdomain, http_host)4243 url = url_parse(path)44 if url_scheme is None:44 url_scheme = app.config['PREFERRED_URL_SCHEME']45 url_scheme = url.scheme or app.config['PREFERRED_URL_SCHEME']4646 url = url_parse(path)47 base_url = '{0}://{1}/{2}'.format(48 url_scheme, url.netloc or http_host, app_root.lstrip('/')49 )50 path = url.path
147 unmodified lines