Closed lpj145 closed 6 years ago
Thank you for your issue, I look at this ASAP
If you use default config, exception work with CORS.
But if you use an other ErrorController you can add this in you ErrorController:
public function beforeRender(Event $event) {
// ...
$this->response = $this->response->withHeader('Access-Control-Allow-Origin', '*');
}
Can you test the new release? https://github.com/ozee31/cakephp-cors/releases/tag/v1.1.0
FYI,
It led to a problem in withCredentials cases where wildcard is not valid. Please try to keep CorsMiddleware logic even in exceptions.
ok @andreyg-moby I would update Exceptions in the next release
@ozee31 as it hangs here for a while, I've added PR for my workaround: https://github.com/ozee31/cakephp-cors/pull/14
Please review, merge & release.
How add CORS on any exceptions ? when i have code 422 or 409 CORS not enabled.