mirror of
https://github.com/benbusby/whoogle-search
synced 2024-11-18 09:25:33 +00:00
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.
This commit is contained in:
parent
fb863b5b52
commit
86ae2bda3e
@ -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
Block a user