Using Open Weather Map which is HTTP only through an HTTPS website and NOT get mixed content warning

后端 未结 3 1317
别跟我提以往
别跟我提以往 2020-12-19 07:37

I checked out this link here on SO: Dealing with HTTP content in HTTPS pages

I tried this regarding open protocols from here: http://benpowell.org/https-and-http-the

3条回答
  •  误落风尘
    2020-12-19 08:13

    Stumbled upon this thread while trying to get my application hosted on heroku while using the Open Weather Map API.

    Put this in front of the url:

    https://cors-anywhere.herokuapp.com/

    so that the url becomes

    https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/forecast? appid=${API_KEY}

    Check your application again and note that the openweather url is http again (the way it was originally)! This solution worked for me, although the CORS solution may not last forever.

提交回复
热议问题