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

Missing CORS Header #36

Open
Loan-Shark opened this issue Apr 11, 2022 · 2 comments
Open

Missing CORS Header #36

Loan-Shark opened this issue Apr 11, 2022 · 2 comments

Comments

@Loan-Shark
Copy link

Unable to query API within other sites

- Unsure if this is an intended effect (sorry if so)


At the moment the api cannot be queried from other websites and the URL must be entered manually.
This is due to a missing response header.

Cross-Origin Resource Sharing A security feature that by default disallows foreign requests to a server for security purposes. (ie to prevent spoofing) CORS must be allowed by supplying the following response header Access-Control-Allow-Origin: *
With * Meaning any origin, if this header is missing then the client's browser will block the request.

I was interested in using this api for a personal project and was disappointed to see the request fail. If this behavior is intended or you are no longer interested in maintaining this project then I completely understand!


Otherwise I hope you would be amenable to implementing the fix suggested above. (Unfortunately I'm not so knowledgeable in PHP as to be able to implement this change myself otherwise I wouldn't bother you as such)

Thanks either way and happy coding!

@jpmurray
Copy link
Owner

I'm slowly getting back to work after a health hiatus, let me check all of this, I'll get back to you as soon as I can ! :)

@bomotayo
Copy link

bomotayo commented Jan 1, 2023

Hello Happy New Year,
Would adding something like this under <?php work? (sorry also not very knowledgable in php)
header("Access-Control-Allow-Origin: *");

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

3 participants