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

CORS Issue - No Access-Control-Allow-Origin set #4

Open
zachurich opened this issue Feb 19, 2018 · 5 comments
Open

CORS Issue - No Access-Control-Allow-Origin set #4

zachurich opened this issue Feb 19, 2018 · 5 comments

Comments

@zachurich
Copy link

When running webpack-dev-server, I face issues with CORS preventing me from making a complete request with wikiquote.

Is there anyway I can set this myself or should this be configured within the module?

@fdesjardins
Copy link
Owner

Ah, yeah, this was developed for server-side JS, so you're going to get CORS issues unless we switch to using JSONP. I don't think there's a setting that will let us get around that.

I wouldn't be opposed to adding that functionality, though. I don't see any reason why this module couldn't also work in a browser environment.

@zachurich
Copy link
Author

That would be really helpful. I'm attempting to build a little app that lets the user get a random quote upon user input and I would like to keep it all client-side if possible. Great work on this btw! A promise-based interface for the wikiquote API is a god-send.

@rizsyed1
Copy link

Hi, I am also getting this CORS issue, and I am also trying to build a random quote machine. Has this been patched?

@fdesjardins
Copy link
Owner

Hey @RizwanSyed357, no, I haven't patched this yet. I use it primarily on the server, so I haven't hit the CORS issue myself. I'll take a look into adding it, but I'd appreciate a PR if you wanna take a stab at it.

@phocks
Copy link

phocks commented Mar 21, 2021

This might be helpful. I've had success with CORS in browser on wikimedia apis just by adding &origin=* to the request. It could be pretty easy to modify each request to add this.

https://www.mediawiki.org/wiki/API:Cross-site_requests

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