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

Add 'Access-Control-Allow-Origin' header to the resources requested via API #242

Closed
annapawlicka opened this issue Aug 25, 2014 · 7 comments

Comments

@annapawlicka
Copy link

When I make an ajax GET request, I see this error:

XMLHttpRequest cannot load https://clojars.org/stats/all.edn. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

Asking for format=jsonp returns plain json so the only workaround seems to be using a proxy where my server would make a request to clojars while my application would make a request to my server. I'd like to avoid that since the application is so tiny it doesn't need a server.

Is there any chance the make the API respond with Access-Control-Allow-Origin header?

@danielcompton
Copy link
Member

@annapawlicka are you only looking for it for /stats?

@tobias
Copy link
Member

tobias commented Jul 8, 2015

I think this would be appropriate on /stats, /api, /search, and any of the /latest-version routes, since they all produce public json data.

@danielcompton thanks for jumping in :)

@annapawlicka
Copy link
Author

what @tobias said :)

@thiagofm
Copy link

Will work on that. 👍

@tobias
Copy link
Member

tobias commented Jul 31, 2015

Great, thanks @thiagofm. Feel free to ping me if you have any issues or questions.

@tobias tobias closed this as completed in b357243 Jan 9, 2016
@tobias
Copy link
Member

tobias commented Jan 9, 2016

Reopening, since we don't yet have it for stats. That will need to be added to the nginx config.

@tobias tobias reopened this Jan 9, 2016
@tobias
Copy link
Member

tobias commented Jan 9, 2016

nginx config for /stats updated with:

add_header Access-Control-Allow-Origin *;

@tobias tobias closed this as completed Jan 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants