diff --git a/core/App.php b/core/App.php index 9d5e750..92017ef 100644 --- a/core/App.php +++ b/core/App.php @@ -124,23 +124,28 @@ public static function process(Request $Request, Response $Response) { switch (true) { case $response === 1: + $Response->header('Content-type', 'text/html;charset=utf-8'); return View::create($Request->getAction())->set($vars); break; case $response instanceof View: + $Response->header('Content-type', 'text/html;charset=utf-8'); return $response->set($vars); break; case is_string($response): + $Response->header('Content-type', 'text/plain;charset=utf-8'); return View::fromString($response); break; case is_array($response): case is_object($response): + $Response->header('Content-type', 'application/json;charset=utf-8'); return View::fromString(json_encode($response, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); break; default: + $Response->header('Content-type', 'text/plain;charset=utf-8'); return View::fromString((string) $response); } } diff --git a/skel/app/main.php b/skel/app/main.php index 93121f6..240d12e 100644 --- a/skel/app/main.php +++ b/skel/app/main.php @@ -1,7 +1,7 @@ header('Content-type', 'text/html;charset=utf-8'); +$Response = Response::create(200); $View = App::process(Request::create(), $Response) ->prepend('_head') ->append('_foot')