From 744f3d81c93955500f1f93a40ec1a5eb61d883c1 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Sat, 29 Nov 2014 14:29:58 +0000 Subject: [PATCH] Removed check for image/png content-type 14:08 blahdeblah: Quick question about the portgroups api route, you added a check for image/png 14:09 I'm not sure that's what that function is meant for. Event sending -H "Accept: image/png" on a curl request fails. I think this is for checking if you send an image to the api rather than what's to be output 14:27 Sending -H "Content-type: image/png" works but this for defining what content-type the request will send. 14:29 I think the curl request needs to send an Accept and then the API check for this, I'll put a PR through to remove the current code until it can be looked at in more detail. --- html/includes/api_functions.inc.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/html/includes/api_functions.inc.php b/html/includes/api_functions.inc.php index 2b12d4a374..607c4cacd0 100644 --- a/html/includes/api_functions.inc.php +++ b/html/includes/api_functions.inc.php @@ -380,13 +380,6 @@ function list_bgp() { function get_graph_by_portgroup() { global $config; $app = \Slim\Slim::getInstance(); - if ($app->request->getMediaType() != "image/png") { - // we only support PNG graphs at the moment - $app->response->setStatus(406); // Not Acceptable - echo("

Not Acceptable

\n"); - echo("

Only media type 'image/png' is provided at present

\n"); - return; - } $router = $app->router()->getCurrentRoute()->getParams(); $group = $router['group']; $vars = array();