mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
missed out the response code and header
This commit is contained in:
@@ -454,7 +454,6 @@ function get_vlans() {
|
|||||||
$app = \Slim\Slim::getInstance();
|
$app = \Slim\Slim::getInstance();
|
||||||
$router = $app->router()->getCurrentRoute()->getParams();
|
$router = $app->router()->getCurrentRoute()->getParams();
|
||||||
$hostname = $router['hostname'];
|
$hostname = $router['hostname'];
|
||||||
$status = "error";
|
|
||||||
$code = 500;
|
$code = 500;
|
||||||
if(empty($hostname)) {
|
if(empty($hostname)) {
|
||||||
$output = $output = array("status" => "error", "message" => "No hostname has been provided");
|
$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");
|
$output = array("status" => "error", "Device $hostname not found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$app->response->setStatus($code);
|
||||||
|
$app->response->headers->set('Content-Type', 'application/json');
|
||||||
echo _json_encode($output);
|
echo _json_encode($output);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user