All of a sudden I’m getting CORS errors:
“Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://damp-island-15072.herokuapp.com/tag/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 503.”
The fetching code looks like so:
const BASE_URL = 'https://damp-island-15072.herokuapp.com';
class A2Api {
static token;
static async request(endpoint, data = {}, method = "get") {
const url = `${BASE_URL}/${endpoint}`;
const headers = {
Authorization: `Bearer ${A2Api.token}`,
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods':'GET,PUT,POST,DELETE,PATCH,OPTIONS',
};
const params = (method === "get")
? data
: {};
try {
return (await axios({ url, method, data, params, headers })).data;
} catch (err) {
console.error("API Error:", err.response);
let message = err.response.data.error.message;
throw Array.isArray(message) ? message : [message];
}
}
and has not change before or after this started happening.
It started right after I added some things to the css style sheet. I can’t imagine that this is the cause. This has happened before and then stopped suddenly. I didn’t think much of it at the time but now that it’s going on again I just want to know what’s happening. Is this on my end?