diff options
| -rw-r--r-- | index.php | 3 | ||||
| -rw-r--r-- | private/View/Output.php | 5 |
2 files changed, 3 insertions, 5 deletions
@@ -23,6 +23,9 @@ spl_autoload_register( use AugustOffensive\View; use AugustOffensive\Controller; +// configure content type before anything is output +header("Content-Type: application/" + View\Main::TYPE); + try { // initiate connection and build front-end $connection = Controller\Controller::initiateConnection(); diff --git a/private/View/Output.php b/private/View/Output.php index fe42c15..8773e42 100644 --- a/private/View/Output.php +++ b/private/View/Output.php @@ -21,11 +21,6 @@ class Output */ public static function json (Model\Result $result, bool $prepare = true): string { - // breaks side effect rule? - if ($prepare) { - header("Content-Type: application/json"); - } - return json_encode(array( "Result-Type" => $result->getResultType(), "Content" => $result->getResult() |
