Closed whyvez closed 4 years ago
If HTTP_URL is set and FORCE_HTTPS is false all requests use HTTP with the exception of the first style fetch request.
HTTP_URL
FORCE_HTTPS
The root cause is in the style function in the format_url module forces HTTPS regardless of the config.
style
format_url
https://github.com/mapbox/mapbox.js/blob/a606ef3d082a55a48983a2197822b5446babed09/src/format_url.js#L52-L60
The request module is already equipped with making decisions on the protocol based on the config and other variables, why not defer that decision to the request module?
request
I propose we remove the explicit replace in line https://github.com/mapbox/mapbox.js/blob/publisher-production/src/format_url.js#L57
If
HTTP_URL
is set andFORCE_HTTPS
is false all requests use HTTP with the exception of the first style fetch request.The root cause is in the
style
function in theformat_url
module forces HTTPS regardless of the config.https://github.com/mapbox/mapbox.js/blob/a606ef3d082a55a48983a2197822b5446babed09/src/format_url.js#L52-L60
The
request
module is already equipped with making decisions on the protocol based on the config and other variables, why not defer that decision to the request module?I propose we remove the explicit replace in line https://github.com/mapbox/mapbox.js/blob/publisher-production/src/format_url.js#L57