Skip to content

CORS / cross origin API request blocked by header of requested resource? #1

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

Open
NicholasKyleHoffman opened this issue Feb 9, 2019 · 2 comments

Comments

@NicholasKyleHoffman
Copy link
Owner

Access to XMLHttpRequest at 'http://api.openrates.io/latest?base=USD&symbols=GBP' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

** FROM axios API call in Converter.js:41
Oops, something broke with GET in convertHandler() - we've got a: Network Error

@NicholasKyleHoffman
Copy link
Owner Author

This is blocking the core functionality of converting To / From currencies!

@NicholasKyleHoffman
Copy link
Owner Author

WORKAROUND NOTE - working app at: ()

I updated the GET in convertHandler to pull
FROM: http://api.openrates.io.... CURRENT URL in Git Project ->
TO: 'https://api.openrates.io...." in codesandbox (which is https://codesand....)
& it works... It has to do with CORS & requesting resources -

Dev environment: localhost vs. http vs. https workarounds:

"You’ve run afoul of the Same Origin Policy – it says that every AJAX request must match the exact host, protocol, and port of your site. Things that might cause this:

References:

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

1 participant