Wttr.in: Fetch blocked by CORS policy.

Created on 2 Jun 2020  路  7Comments  路  Source: chubin/wttr.in

Hello,
I'm a Mobile Apps Developer and i'm using Ionic Framework to create one.

I've been using Wttr.in for the past 2 months without fails but, yesterday, I came across this error:
Image Pasted at 2020-6-1 22-31

Before, everything worked perfectly, and I wasn't expecting to have this error. After searching the Internet, I got the feeling that your server is not accepting external requests.

Interestingly, the request works in python, doing something like that:

import requests
r = requests.get("http://wttr.in?format=j1")
print(r.json())

But when I make an asynchronous request using Javascript or Typescript I get a CORS error - on browser and Android.

Most helpful comment

Sorry, it was my fault.
Please test it now

$ curl -I wttr.in
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Tue, 02 Jun 2020 11:17:13 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 8781
Connection: keep-alive
Access-Control-Allow-Origin: *

All 7 comments

Sorry, it was my fault.
Please test it now

$ curl -I wttr.in
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Tue, 02 Jun 2020 11:17:13 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 8781
Connection: keep-alive
Access-Control-Allow-Origin: *

If your app is free, give a link to it, and we can add it to the README file

Sorry, it was my fault.
Please test it now

$ curl -I wttr.in
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Tue, 02 Jun 2020 11:17:13 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 8781
Connection: keep-alive
Access-Control-Allow-Origin: *

Thanks! Everything works fine now.
My app is a product from the enterprise where I work. :)

Very good! Do you have a link? Let's see it

I close the issue, but the question about the app is still relevant.
If you want to share your app, just post the link!

Hijacking this a bit :)

Found this issue and implemented weather for airports! See for example https://flightnotebook.com/airports/JFK/

Wow! It looks very cool, and maybe #453 would be interesting to you. @mcantsin has disappeared, but the issue is still relevant, and the features should be implemented, so maybe you have some improvement ideas

Was this page helpful?
0 / 5 - 0 ratings

Related issues

532910 picture 532910  路  7Comments

natehouk picture natehouk  路  4Comments

Quenty-tolosan picture Quenty-tolosan  路  9Comments

chubin picture chubin  路  7Comments

532910 picture 532910  路  9Comments