Rob--W / cors-anywhere

CORS Anywhere is a NodeJS reverse proxy which adds CORS headers to the proxied request.
MIT License
8.5k stars 5.92k forks source link

Authorization error #472

Closed fconsani closed 9 months ago

fconsani commented 9 months ago

Hello,

When trying to reach this endpoint :

https://api.kraken.com/0/public/Assets

I have this error :

{"error":[{"severity":"E","errorClass":"Auth","type":"Authorization error"}]}

Here is my server code :

var host = '0.0.0.0'; var port = 7000;

var cors_proxy = require('cors-anywhere'); cors_proxy.createServer({ removeHeaders: ['cookie', 'cookie2'], //requireHeader: ['origin', 'x-requested-with'] //setHeaders: {'origin':'https://api.kraken.com','refer':'https://api.kraken.com', 'Authorization': 'Basic'} }).on('request', function (req, res) { var date = new Date(); console.log('/' + req.method + " on "+req.url +" - "+date.toLocaleString()); var ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress; console.log("FROM " + ip) }).listen(port, host, function() { console.log('Running CORS Anywhere on ' + host + ':' + port); });

BR, Franck

Rob--W commented 9 months ago

This response is from kraken, not my library.

Without having wasted more time at looking into the specific issue, my guess is that your client-side code didn't specify the right credentials in the request header.