From 3ddc0dd90e4e01dbf32d1c4acc499b9efd214943 Mon Sep 17 00:00:00 2001 From: pxgamer Date: Mon, 8 Oct 2018 12:39:16 +0100 Subject: [PATCH] Add JSON header setting to the api functions --- include/functions.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/functions.inc.php b/include/functions.inc.php index 46abc9b..4c3ceb9 100755 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -24,6 +24,10 @@ function san_host($a) function api_err($data) { global $_config; + + if (!headers_sent()) { + header('Content-Type: application/json'); + } echo json_encode(["status" => "error", "data" => $data, "coin" => $_config['coin']]); exit; } @@ -32,6 +36,10 @@ function api_err($data) function api_echo($data) { global $_config; + + if (!headers_sent()) { + header('Content-Type: application/json'); + } echo json_encode(["status" => "ok", "data" => $data, "coin" => $_config['coin']]); exit; }