5 ms·
Wait what The main premise of this post is false. The mentioned request can’t succeed without first completing a preflight check.
by demarq 2y ago
Wait what
The main premise of this post is false.
The mentioned request can’t succeed without first completing a preflight check.
- garaetjjte 2y agoIt depends on content-type.
- demarq 2y agoI find it difficult to assume that’s what the author meant especially since they made no mention of content type. It doesn’t seem the author was aware of content type once you see their solution. Normally I would give the benefit of the doubt, but the “fix” is pretty damming here.
- davidfiala 2y agoIt depends on including things like headers and other non-approved changes to the request. Content-Type is one of them, but even it has some whitelisted options. Read about 'simple' requests to see what you can and cannot do before a preflight is required: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simpl...
- demarq 2y agoProbably you didn’t see my first reply. Put simply if I make cross origin POST request that’s JSON type it cannot be a simple request. There are no ways around this
- davidfiala 2y agoDidn't see it :) you nailed it!