ci3 cors doesn't works |
CORS is ... fun ... In my current project I have a Sencha Ext JS front-end and a CI 4.0.4 back-end and it's working fine.
Have you checked the debugger in the browser for any messages? In Chrome you have to select "All" under Network tab to see the OPTIONS requests (they don't show up under XHR for some reason). I also use Charles proxy to really see what's going on. I route all my OPTIONS request to a single function that returns this: PHP Code: return $this->response->setHeader('Access-Control-Allow-Methods', 'DELETE, POST, GET, PUT, OPTIONS') If the browser is happy with that it will send the actual request. For my front-end the withCredentials needs to be set on the XHR request (https://developer.mozilla.org/en-US/docs...redentials) and also cors to generate XDomainRequests (https://docs.sencha.com/extjs/7.2.0/mode....Ajax.html) Remember that cookies could also be hard to get working cross-domain. I'm using Bearer Authorization instead. Good luck! /Mattias |
Messages In This Thread |
ci3 cors doesn't works - by ultegro778 - 11-29-2020, 11:47 AM
RE: ci3 cors doesn't works - by InsiteFX - 11-30-2020, 12:16 PM
RE: ci3 cors doesn't works - by ultegro778 - 12-02-2020, 12:35 PM
RE: ci3 cors doesn't works - by InsiteFX - 12-02-2020, 10:36 PM
RE: ci3 cors doesn't works - by tgix - 12-03-2020, 03:43 AM
|