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.
pull/254/head
Ben Busby 4 years ago
parent fb863b5b52
commit 86ae2bda3e
No known key found for this signature in database
GPG Key ID: 3B08611DF6E62ED2

@ -25,7 +25,7 @@ def needs_https(url: str) -> bool:
"""
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://')
return (is_heroku and is_http) or (https_only and is_http)

Loading…
Cancel
Save