Skip to content

Commit

Permalink
Merge pull request #7 from uniondrug/2.x
Browse files Browse the repository at this point in the history
core catch
  • Loading branch information
fuyibing authored Apr 24, 2018
2 parents 80df466 + 1bad1c3 commit 66de767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Middlewares/CorsMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function handle(RequestInterface $request, DelegateInterface $next)
try {
$response = $next($request);
} catch(\Exception $e) {
$response = $this->response;
$response = $this->serviceServer->withError($e->getMessage(), $e->getCode());
}
if ($response instanceof ResponseInterface) {
$response->setHeader('Access-Control-Allow-Origin', $request->getHeader('Origin'));
Expand Down

0 comments on commit 66de767

Please sign in to comment.