codeigniter4-cors icon indicating copy to clipboard operation
codeigniter4-cors copied to clipboard

Codeigniter 4.4.4 CORS not work

Open abmcr opened this issue 1 year ago • 2 comments

With the last CI i get always this error

Access to XMLHttpRequest at 'https://ci4api.test/API/v1/locations' from origin 'http://localhost:9001' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

abmcr avatar Jan 13 '24 16:01 abmcr

Same problem here, i seems that CI is not loaded and can't handle the cors, it must be set as a server rule.

Valkhan avatar Feb 17 '24 20:02 Valkhan

Use this gist for now CodeIgniter 4 CORS Configuration

jccallo avatar Mar 26 '24 19:03 jccallo