'NodeJS Axios Block CORS
I'm trying to configure axios running in a NodeJS server app to deliberately block on CORS. As in, I'm trying to test my setup to ensure that CORS have been configured correctly.
The issue I'm facing is that axios is ignoring the CORS rule and does the query anyway, regardless of the API server setup. Running the application from the browser blocks on CORS violations correctly, however I need to be able to automate the testing of CORS.
Can someone please let me know how I can tell axios to error out on a CORS violation?
await axios.post(url, query, {timeout: 1000 * 15})
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
