Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:ozee31/cakephp-cors
Browse files Browse the repository at this point in the history
  • Loading branch information
ozee31 committed Dec 20, 2018
2 parents d9bd162 + e59a78e commit 68ad815
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
*/
EventManager::instance()->on('Server.buildMiddleware',
function ($event, $middleware) {
$middleware->insertBefore(RoutingMiddleware::class, new CorsMiddleware());
try {
$middleware->insertBefore(RoutingMiddleware::class, new CorsMiddleware());
} catch (\LogicException $exception) {
$middleware->add(new CorsMiddleware());
}
}
);

0 comments on commit 68ad815

Please sign in to comment.