Why not let Access-Control-Allow-Origin?

Hi!
Send AJAX GET request to your external service
CORS is set up with a library barryvdh/laravel-cors

'supportsCredentials' => false,
 'allowedOrigins' => ['*'],
 'allowedOriginsPatterns' => [],
 'allowedHeaders' => ['*'],
 'allowedmethods element' => ['*'],
 'exposedHeaders' => [],
 'maxAge' => 0,


Everything worked as it should. After migrating to another server, in the console error
Access to XMLHttpRequest at 'https://путь_на_внешний_сервис' from origin 'http://сайт' has been blocked by CORS policy: Response to a preflight request doesn't pass the access control check: The 'Access-Control-Allow-Origin' header contains multiple values 'http://сайт, *', but only one is allowed.


Something is missing in the settings?
March 19th 20 at 08:27
1 answer
March 19th 20 at 08:29
Solution
Helped translate the value of the allowedOrigins array to a string
'allowedOrigins' => '*'

Find more questions by tags CORS