Open webds opened 1 year ago
my quick solution
if (static::isOriginAllowed($origin)) {
$originHeader = ($origin == '*')?$origin:($_SERVER['HTTP_ORIGIN'] ?? $_SERVER['HTTP_HOST']);
Headers::accessControl(
'Allow-Origin',
$originHeader
);
}
Hi @webds, I'm just seeing this issue. Do you mean you are not able to set your own origins using app()->cors()
hey! im having the same error, i dont know what to do to solve it
https://github.com/leafsphp/cors/blob/10934a7504879ecf9b6f7687926c22a3b5c02ce9/src/Cors.php#LL71C4-L71C4
There is an error here. If we want to set a custom Allow-Origin, we won't be able to do it. For example, if I want to set the value "*", it will still not be accepted. The AJAX request will throw an error: ...has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.