Answer the question
In order to leave comments, you need to log in
How to remove title from OPTIONS?
Hello everyone, when sending a request to another site, an error appears in the console:
Access to fetch at ' https://min-api.cryptocompare.com/data/price?fsym=... ' from origin ' localhost:3000 ' has been blocked by CORS policy: Request header field x-compress is not allowed by Access-Control-Allow-Headers in preflight response.
refreshFetch = async (url) => {
try {
return await (await fetch(url)).json();
} catch (e) {
throw Error('Ошибка');
}
};
Thank you!
Answer the question
In order to leave comments, you need to log in
Ran into the same issue, seems only relevant for chrome on mac.
It arose literally yesterday, until I found no solutions, except to add a field in response to Options on the backend.
Good afternoon!
You can add x-compress to the header, maybe this will help you:
app.use("/", (req, res, next) => {
/* */
res.setHeader("Access-Control-Allow-Headers", "accept, authorization, content-type, x-compress");
/* */
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question