Skip to content

Commit cb3be11

Browse files
committed
Fixed issue related with returning Response instance to json.
1 parent 981c0d2 commit cb3be11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/RouterCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ protected function sendResponse($response)
363363
if (is_array($response) || strpos($this->request->headers->get('Accept'), 'application/json') !== false) {
364364
$this->response->headers->set('Content-Type', 'application/json');
365365
return $this->response
366-
->setContent(json_encode($response))
366+
->setContent($response instanceof Response ? $response->getContent() : json_encode($response))
367367
->send();
368368
}
369369

0 commit comments

Comments
 (0)