xDimGG / node-steamapi

An object-oriented Steam API wrapper for Node.js developers.
https://www.npmjs.com/package/steamapi
181 stars 42 forks source link

CORS modification support #17

Closed eoussama closed 4 years ago

eoussama commented 5 years ago

I've been trying to get around this error:

No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

It would be cool if we were able to modify the headers of the request.

xDimGG commented 4 years ago

You can change the headers property on the SteamAPI class after instantiating it. https://github.com/xDimGG/node-steamapi/blob/84043e55e071724ce4ea0a286052e447c2781d64/src/SteamAPI.js#L37

Edit: Though I don't have time to test, it probably won't work due to Steam's headers. This package is intended to be used with Node.