zf-fr / zfr-cors

A Zend Framework 2 module that helps you to deal with Cross-Origin Resource Sharing (CORS)
MIT License
60 stars 39 forks source link

Problem with redefinition cors options in route #57

Closed wyster closed 5 years ago

wyster commented 5 years ago

Hello

I have global config: 'zfr_cors' => [ 'allowed_origins' => ['http://example.com'], 'allowed_methods' => ['GET'] ]

And route with option: \ZfrCors\Options\CorsOptions::ROUTE_PARAM => [ 'allowed_origins' => ['*'] ]

It isn't worked, output from chrome console:

GET https:/site.loc/ 403 (The origin "https://fiddle.jshell.net" is not authorized)
Access to fetch at 'https://site.loc/' from origin 'https://fiddle.jshell.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Failed to fetch