Max F hace 5 años
padre
commit
757f6be334
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/Http/Response.php

+ 3 - 0
src/Http/Response.php

@@ -179,6 +179,9 @@ class Response
 	
 	public function setJson($body, $status=200, $content_type='application/json')
 	{
+		if (! is_string($body)) {
+			$body = json_encode($body);
+		}
 		return $this->setBody($body)
 				->setContentType($content_type)
 				->setStatus($status);