Skip to content

Commit

Permalink
Fixed issue related with returning Response instance to json.
Browse files Browse the repository at this point in the history
  • Loading branch information
izniburak committed Jan 18, 2022
1 parent 981c0d2 commit cb3be11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RouterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit cb3be11

Please sign in to comment.