News for hackers. Stuff that matters.
Re:Developers don't understand CORS by untog on Wednesday July 10, 2019 @03:56PM (#20405874)
> Remove cookies and basic auth headers, what's the point of CORS?

The ability to communicate with a domain other than the one your app is running on. For instance, if my site on www.example.com wants to send a POST to www.example2.com, I need CORS. example2.com needs CORS to specify that only example.com is allowed to send a POST to it, not anyoldaddress.com. example2.com could look at the Origin header and refuse connections, but it would be vulnerable to DDOS attacks.

Now, if your SPA is entirely self-contained and self-hosted then no, you don't need CORS. But there are plenty of situations where that isn't the case.

Re:Developers don't understand CORS by throwamay1241 on Wednesday July 10, 2019 @04:23PM (#20406128)
I don't think the act of sending the POST is blocked by CORS, receiving the POSTed response data is though.
Re:Developers don't understand CORS by disiplus on Wednesday July 10, 2019 @04:13PM (#20406034)
yup, i have a signup form on our website and that signup form calls ajax if the email is in use. without cors i would have to use jsonp or some other workaround.