Closed alysson-azevedo closed 7 years ago
i'm not sure if it works, but how about using Cake\Core\App::classname('Error', 'Controller', 'Controller')
to return the correct ErrorController classname?
OK, I see the problem. I will try to do differently to get around the problem.
Same problem here :)
Looks like using
use Cake\Controller\ErrorController as BaseErrorController;
solves the problem here. @alysson-azevedo : you might want to test.
Edit : naaaa... This is not a universal solution. Forget about it. Sorry.
Ok, with the new release you can change the ErrorController class.
In app.php you can write
'Cors' => [
'ErrorController' => 'Other\Namespace\ErrorController',
]
but in this controller you must add
public function beforeRender(Event $event) {
// ...
$this->response->header(['Access-Control-Allow-Origin' => '*']);
}
It's OK for you ?
seems good for me.
Since I don't use App as my namespace, this line raises an error.