From c55c1a71ba65b1c016babcad55bda9b1a17e8eb0 Mon Sep 17 00:00:00 2001 From: laf Date: Wed, 1 Oct 2014 21:12:21 +0100 Subject: [PATCH] missed out the response code and header --- html/includes/api_functions.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/html/includes/api_functions.inc.php b/html/includes/api_functions.inc.php index d85f4e0fb..dbadd26f8 100644 --- a/html/includes/api_functions.inc.php +++ b/html/includes/api_functions.inc.php @@ -454,7 +454,6 @@ function get_vlans() { $app = \Slim\Slim::getInstance(); $router = $app->router()->getCurrentRoute()->getParams(); $hostname = $router['hostname']; - $status = "error"; $code = 500; if(empty($hostname)) { $output = $output = array("status" => "error", "message" => "No hostname has been provided"); @@ -475,5 +474,7 @@ function get_vlans() { $output = array("status" => "error", "Device $hostname not found"); } } + $app->response->setStatus($code); + $app->response->headers->set('Content-Type', 'application/json'); echo _json_encode($output); }