Closed Chococoin closed 5 years ago
I've found a solution.
Set the mode as 'no-cors' doesn't work too much, and for production is not a good practice. I think the best way to do that is adding a header key (Origin) in the request with the own url as value.
Hence, as a patch for who use reacts is enough to add headers['Origin'] = '
Working with React 16.4 it doesn't allow responses without Access-Control-Allow-Origin'. I've got this error:
Failed to load https://api.kraken.com/0/private/Balance: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
How can we set the request to {'mode': 'no-cors'}?
Thank for your help.