From b9d2b8467dd4046512b86e0f63feefb6b06c2789 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Tue, 13 Oct 2009 08:34:05 +0300 Subject: App/json header fixes --- App.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'App.php') diff --git a/App.php b/App.php index 141e333..442ca8c 100644 --- a/App.php +++ b/App.php @@ -90,15 +90,19 @@ class App static function ok($msg) { $ok = array('result' => 'ok', 'msg' => $msg); - header("Content-type application/json"); - return json_encode($ok); + $json = json_encode($ok); + header("Content-Type: application/json"); + header("Content-Length: " . strlen($json)); + print $json; } static function error($msg) { $err = array('result' => 'error', 'msg' => $msg); - header("Content-type application/json"); - return json_encode($err); + $json = json_encode($err); + header("Content-Type: application/json"); + header("Content-Length: " . strlen($json)); + print $json; } /** -- cgit v1.2.3