Hotfix: Upgrade heroku apps to https for all endpoints
The previous implementation of the is_heroku check in search.needs_https() was implemented to only match URLs ending in '.herokuapp.com', and skipped upgrading to HTTPS for other endpoints.main
parent
3312072cc1
commit
ed4432f3f8
|
@ -25,7 +25,7 @@ def needs_https(url: str) -> bool:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
https_only = bool(os.getenv('HTTPS_ONLY', 0))
|
https_only = bool(os.getenv('HTTPS_ONLY', 0))
|
||||||
is_heroku = url.endswith('.herokuapp.com')
|
is_heroku = '.herokuapp.com' in url
|
||||||
is_http = url.startswith('http://')
|
is_http = url.startswith('http://')
|
||||||
|
|
||||||
return (is_heroku and is_http) or (https_only and is_http)
|
return (is_heroku and is_http) or (https_only and is_http)
|
||||||
|
|
Loading…
Reference in New Issue