News for hackers. Stuff that matters.
Re:CORS is not meant to secure an API endpoint by masklinn on Sunday February 13, 2022 @11:25AM (#30322828)
> It is more complex than that, because certain kinds of cross-site requests has always been allowed. GET and POST requests are allowed

Request headers and body content-type are also a factor for POST, anything which couldn't be set through a FORM is forbidden.

The most common issue is that the request is only simple if its content-type is `application/x-www-form-urlencoded`, `multipart/form-data`, or `text/plain`. JSON POST requests usually run afoul that. The second big issue is setting bespoke headers as only Accept, Accept-Language, Content-Language, and Content-Type (restricted to the above list) are simple. There common sticking points are headers like Authorization.

There are no comments on this comment yet.