nasa / api-docs

api.nasa.gov
http://nasa.github.io/api-docs/
443 stars 106 forks source link

CORS is not enabled for Curiosity without a Demo API Key on Mars-Photos API #83

Closed berraknil closed 7 years ago

berraknil commented 7 years ago

Hi, I'm currently making a web app using the Mars-Photos API, the problem is if I don't use a DEMO_KEY (which as you might guess only allows for a certain amount of calls) and use my specific dev key instead, I can only request information about Opportunity and Spirit rovers and Curiosity just gives me a "No 'Access-Control-Allow-Origin' header is present on the requested resource." error. mars-photos-curiosity-error

Was wondering if it's possible to check to see what might be going wrong with CORS regarding that?

ps. all three rovers work correctly when just fetching JSON but not when trying to get data via Promises (using React, Redux and Axios), Curiosity always gives a CORS error.

Thanks for your time :)

jasonduley commented 7 years ago

@chrisccerami please chime in on this one. thanks.

berraknil commented 7 years ago

I would really love to have an update on this, at least a confirmation if this is from a server side CORS problem or not, since it's breaking the app I'm working on right now, rendering it useless. Thank you for your time.

@jasonduley thank you for the response.

brianthomas commented 7 years ago

AFAIK, nobody is actively developing this code. I would love to see it open sourced so that the community could contribute patches (I don’t have cycles to fix it either), but Software Release Authority folks are very slow. We are trying tho.

=]brian

From: Berrak Nil Boya notifications@github.com Reply-To: nasa/api-docs reply@reply.github.com Date: Wednesday, March 22, 2017 at 12:55 AM To: nasa/api-docs api-docs@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [nasa/api-docs] CORS is not enabled for Curiosity without a Demo API Key on Mars-Photos API (#83)

I would really love to have an update on this, at least a confirmation if this is from a server side CORS problem or not, since it's breaking the app I'm working on right now, rendering it useless. Thank you for your time.

@jasonduleyhttps://github.com/jasonduley thank you for the response.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/nasa/api-docs/issues/83#issuecomment-288298531, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADzTmbGcjj_CLNoEMN932DH4Gl1iz_Mlks5roKmwgaJpZM4MiO3e.

berraknil commented 7 years ago

@brianthomas Thanks for the reply! I agree that it would be better if these APIs were open sourced and open to contributions. It just seems weird that the other two rover photos are reachable but Curiosity isn't via using a specific API Key, Well, I guess I'm gonna have to stick to the demo key and hope I won't hit the limit since it's a demo concept for now.

corincerami commented 7 years ago

@brianthomas @berraknil I don't know what Brian is talking about. I am the maintainer of the API, and it IS open source. No one has ever contributed any patches, but that doesn't mean that people are not able to or that it is not open source. The repo is located here: https://github.com/chrisccerami/mars-photo-api/. I recommend you open an issue there and I can try to look into it when I get a chance.

jasonduley commented 7 years ago

correct. @chrisccerami maintains this API as a citizen scientist project. @brianthomas and I catalog a bunch more APIs and some of those do not have the source released nor are they actively supported.