Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodePen is blocking Open Weather Map API #8214

Closed
anthkris opened this issue Apr 20, 2016 · 10 comments
Closed

CodePen is blocking Open Weather Map API #8214

anthkris opened this issue Apr 20, 2016 · 10 comments
Labels
help wanted Open for all. You do not need permission to work on these. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.

Comments

@anthkris
Copy link

Challenge Name

https://www.freecodecamp.com/challenges/show-the-local-weather

Issue Description

Show the local weather challenge recommends using Open Weather Map API. Which worked fine up until now. Now you will get an error saying "pen.js:22 Mixed Content: The page at [...] was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://api.openweathermap.org/data/2.5/weather?lat=30.281903699999997&lon=-97.73883819999999&appid=41bf32baf1dc0b1bb46d120a3cbdbc57'. This request has been blocked; the content must be served over HTTPS."

Browser Information

  • Browser Name, Version: Google Chrome, 49.0.2623.112
  • Operating System: Mac OS Yosemite
  • Mobile, Desktop, or Tablet: Desktop

Your Code

// If relevant, paste all of your challenge code in here

Screenshot

@raisedadead
Copy link
Member

raisedadead commented Apr 20, 2016

@anthkris this has been fixed with #8141 .
The changes should reach the main website in a couple of days.

As a work around please open the http version of the CodePen link as in:
http://codepen.io/FreeCodeCamp/full/bELRjV

and not the https link in the challenge.

The link will be updated as soon as the fixes reach main website.

@j7an
Copy link

j7an commented May 16, 2016

Even when I open the http version of the link in Chrome and Firefox, the http call to OpenWeather API is getting blocked. I've already finished my Local Weather project, but I can't submit the project like this on Codepen. The URL works fine when viewing in Safari. I could only think of submitting this project hosted on my own server or find another free weather API that supports SSL.

@raisedadead
Copy link
Member

@j7an refer discussion on #7853

@rolandocz
Copy link

still blocked

@j7an
Copy link

j7an commented May 26, 2017

@rolandocz try forecast.io as mentioned by @149203 here: #7853 (comment)

Or you can try solution here: https://forum.freecodecamp.com/t/local-weather-api-for-people-stuck-because-of-the-https-request/50274/17?u=j7an

@jurisn
Copy link

jurisn commented May 29, 2017

Still blocked

@risingmoon77
Copy link

risingmoon77 commented Jun 10, 2017

https://cors-anywhere.herokuapp.com/
This worked for me if you put it in front of the initial URL
Finally :)

@prakhargvp
Copy link

prakhargvp commented Jun 11, 2017

@risingmoon77 Ya its working fine for me.

$.getJSON("https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?lat="+lat+"&lon="+lon+"&appid=1c48b076cbce09ca93cfff52b6c839c1",function(json){
   // other code goes here
}

@raisedadead codepen is automatically redirected HTTP request to HTTPS so your method does not work.

@raisedadead raisedadead reopened this Jun 11, 2017
@raisedadead raisedadead added type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc. confirmed help wanted Open for all. You do not need permission to work on these. labels Jun 11, 2017
@kennethlumalicay
Copy link
Contributor

You can't do an http request from an https website. And since you have to use https to use navigation.geolocation then the best thing to do is just use an https API like darksky.

@MiloATH
Copy link
Contributor

MiloATH commented Jul 19, 2017

@raisedadead I think this issue can be closed due to #15598

mabelcalim added a commit to mabelcalim/viajemaistempo that referenced this issue Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.
Projects
None yet
Development

No branches or pull requests

9 participants