loading...

re: ✋🏼🔥 CS Visualized: CORS VIEW POST

FULL DISCUSSION
 

Does CORS affect cURL or wget? Or, does enforcing CORS help?

 

Good question! By default, CORS is only enabled in user agents (e.g. a browser). So if I were to send the exact same request using cURL in say the terminal, this request wouldn't automatically contain the Origin header and CORS wouldn't be enabled.

If you want to test whether your server has CORS enabled, you can manually add the Origin header to the request. If the response contains the Access-Control-Allow-Origin header, you know it's working 😃

code of conduct - report abuse