Closed hungnc89 closed 2 months ago
The "Access-Control-Allow-Origin" header is already registered in Apache configurations for all versions of PHP.
If you add a header in your scripts, you will get a duplicate.
Try to edit the config/.../httpd.conf
file according to your needs.
Thank you, as you suggested, I tried removing the allowed origins in my Laravel project, and it worked fine. This behavior is different from version 5 when I configured it with Nginx.
I am using ospanel 6.0.0 and I am experiencing issues with sending AJAX requests, causing the browser to encounter CORS errors.
The browser notice issue : Access to fetch at 'http://waterfalls.local/api/v1/user/login' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains multiple values ', ', but only one is allowed. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Sorry if I wrong.