diff --git a/src/RouterCommand.php b/src/RouterCommand.php index 375ad21..c3c1903 100644 --- a/src/RouterCommand.php +++ b/src/RouterCommand.php @@ -363,7 +363,7 @@ protected function sendResponse($response) if (is_array($response) || strpos($this->request->headers->get('Accept'), 'application/json') !== false) { $this->response->headers->set('Content-Type', 'application/json'); return $this->response - ->setContent(json_encode($response)) + ->setContent($response instanceof Response ? $response->getContent() : json_encode($response)) ->send(); }