The API always returns CORS issue when i make requests
//ERROR
ErrorCode: 2107
ErrorStatus: "OriginHeaderDoesNotMatchKey"
Message: "Origin header does not match the provided API key."
MessageData: {Origin: "http://localhost:3000"}
//CODE
axios
.get(
`https://www.bungie.net/Platform/Destiny2/SearchDestinyPlayer/-1/${id}/`,
{
headers: {
"X-API-Key": process.env.REACT_APP_API_KEY
}
}
)
//Bungie.net

Try using an * for local testing and see if that works.
Worked, thanks
Hello. I'm currently having the same issue here and I would like to see if this solution would work for me, but I'm a bit confused by what you two mean using the *. Is this related to the Access-Control-Allow-Origin header?
In the origin header for local testing use *

Most helpful comment
In the origin header for local testing use
*