open-notify / Open-Notify-API

Source code for api.open-notify.org
http://open-notify.org/Open-Notify-API/
Other
351 stars 72 forks source link

CORS Headers for other routes #25

Open rrcobb opened 6 years ago

rrcobb commented 6 years ago

In response to https://github.com/open-notify/Open-Notify-API/issues/6 it looks like the 'Access-Control-Allow-Origin' header was added to the iss-now route but not to other routes.

$ curl -v "http://api.open-notify.org/iss-pass.json?lat=30&lon=30"
*   Trying 138.68.39.196...
* TCP_NODELAY set
* Connected to api.open-notify.org (138.68.39.196) port 80 (#0)
> GET /iss-pass.json?lat=30&lon=30 HTTP/1.1
> Host: api.open-notify.org
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.10.3
< Date: Thu, 30 Aug 2018 18:51:45 GMT
< Content-Type: application/json
< Content-Length: 517
< Connection: keep-alive
< Via: 1.1 vegur
<
{
  "message": "success",
  "request": {
    "altitude": 100,
    "datetime": 1535654768,
    "latitude": 30.0,
    "longitude": 30.0,
    "passes": 5
  },
  "response": [
    {
      "duration": 366,
      "risetime": 1535673197
    },
    {
      "duration": 639,
      "risetime": 1535678817
    },
    {
      "duration": 499,
      "risetime": 1535684699
    },
    {
      "duration": 468,
      "risetime": 1535702406
    },
    {
      "duration": 636,
      "risetime": 1535708141
    }
  ]
}

The header would be useful for other routes for the same reason mentioned in #6

It looks like #24 has the code to fix this, so maybe all it takes is clicking the merge button!

abesell132 commented 5 years ago

Bump

remes2000 commented 5 years ago

Bump. I can easily get astronauts names and iss position but have CORS issue when I'm trying to use iss-pass route.

aslaker commented 4 years ago

Bump

ryansoeder commented 4 years ago

I would also love to be able to use the Pass Times API but cannot because of this issue.