blocked by CORS :The 'Access-Control-Allow-Origin' header contains multiple values '*, *', Laravel8

Viewed 3361

Access to XMLHttpRequest at 'http://localhost:8000/api/objectives' from origin 'http://localhost:4200' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed.

3 Answers

Head over to the cors.php in config folder and change this 'allowed_origins_patterns' => [], to 'allowed_origins_patterns' => ['*'],

I ran into similar issues. In my case, I fixed it by removing

Header set Access-Control-Allow-Origin "*"

from my .htaccess file.

Related