3 ms·
Is there any way to read the OPTIONS response from JavaScript? I'm guessing not, but if there was, theoretically could you just include your API response in th
by donatj 5y ago
Is there any way to read the OPTIONS response from JavaScript?
I'm guessing not, but if there was, theoretically could you just include your API response in the CORS rejection response?
- corentin88 5y agoNope, because OPTIONS requests have no body [1] [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OP...
- londons_explore 5y agoSo can we place the whole body in a response header called X-Body:?
- corentin88 5y agoWhile it’s definitely not recommended to do so, you could probably do it. You need to test it out though, not sure every browser will support this.
- yaur 5y agoCORS exists to protect the backed from developers that ask these types of questions.
- CrimsonRain 5y agoLet's not be mean to someone asking a question. It is always good to ask, even stupid ones.
- yaur 5y agoI'm not mean to anyone with less karma than me.