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

No access control allow-origin in header #4

Closed
robinBakersSon opened this issue Oct 20, 2016 · 5 comments
Closed

No access control allow-origin in header #4

robinBakersSon opened this issue Oct 20, 2016 · 5 comments

Comments

@robinBakersSon
Copy link

I am having an issue (image attached). From searching online it looks like there is a line of code you could add on your end so that we would be able overcome this issue. I would greatly appreciate any help on this matter. I am very excited to work with this wonderful looking tool. thank you
screen shot 2016-10-20 at 9 23 37 am

@Koleok
Copy link

Koleok commented May 13, 2017

This would be a great change to make as its intended to be a public api

@marktnoonan
Copy link

I use a short PHP script to fetch the data and get around the CORS objection. Not the perfect solution, but you can see it in action here: https://github.com/oddlyaromatic/no-repeat-poets/blob/master/poem-getter.php.

I basically run into CORS issues so often that simply running the request from the server and passing the response back to my JS code is my default solution, and pretty quick to implement.

For really quick in-browser testing, I use this: https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en

It's useful but it will mess up your experience if you accidentally turn it on for regular websites you are just visiting.

I agree it would be nice if this were amended on the server :)

@Koleok
Copy link

Koleok commented May 16, 2017

Thanks @oddlyaromatic !

FYI I also found https://market.mashape.com/thundercomb/poetry-db which solved my silly little use case for a demo app :)

@tenyo tenyo mentioned this issue Jan 2, 2019
@thundercomb
Copy link
Owner

The 'Access-Control-Allow-Origin' header has been added thanks to @tenyo's change.
The pull request has been merged and pushed to the app.

It is now live:

$ curl -H "Origin: http://example.com" --verbose http://poetrydb.org/
*   Trying 52.5.226.222...
* TCP_NODELAY set
* Connected to poetrydb.org (52.5.226.222) port 80 (#0)
> GET / HTTP/1.1
> Host: poetrydb.org
> User-Agent: curl/7.54.0
> Accept: */*
> Origin: http://example.com
> 
< HTTP/1.1 302 Found
< Server: Cowboy
< Connection: keep-alive
< Date: Sun, 13 Jan 2019 10:29:58 GMT
< Status: 302 Found
< Content-Type: text/html;charset=utf-8
< Location: http://poetrydb.org/index.html
< Access-Control-Allow-Origin: *
< Content-Length: 0
< Via: 1.1 vegur
< 
* Connection #0 to host poetrydb.org left intact

@thundercomb
Copy link
Owner

This issue will now be closed but if there are further concerns around it feel free to open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants