I have to download an ics
file with axios,
I tried:
axios.defaults.headers.common['Access-Control-Allow-Origin'] = '*';
axios.get('<url>' {
responseType: 'blob',
headers: {
}
}).then((response) => ...
If I visit the URL with my browser, I instantly get the download.
I’m getting the ERROR:
GET .url CORS Missing Allow Origin
I’m trying all kinds of headers and stuff I’m always getting the same error.
Thanks for your help.
2
Answers
The error you’re seeing ("CORS Missing Allow Origin") indicates that the server hosting the resource (the ics file) is not configured to allow requests from your domain.
This is a common security feature of web browsers called "Same-Origin Policy", which prevents web pages from making requests to resources on different domains, unless those domains explicitly allow it.
To resolve this issue, you need to make sure that the server hosting the resource allows requests from your domain. You can do this by adding the appropriate CORS headers to the server response.
This error occurs when a web page tries to access resources from a different domain than the one that served the page. This is a security feature implemented by web browsers to prevent malicious scripts.
There are 2 ways that you can use to bypass this error:-