diff --git a/jsonAPI/JsonApiMiddleware.php b/jsonAPI/JsonApiMiddleware.php index 71e947f..f605fa5 100644 --- a/jsonAPI/JsonApiMiddleware.php +++ b/jsonAPI/JsonApiMiddleware.php @@ -30,7 +30,6 @@ class JsonApiMiddleware extends \Slim\Middleware { function __construct(){ $app = \Slim\Slim::getInstance(); - $app->config('debug', false); // Mirrors the API request $app->get('/return', function() use ($app) { @@ -63,9 +62,10 @@ function __construct(){ // Handle Empty response body $app->hook('slim.after.router', function () use ($app) { - //Fix sugested by: https://github.com/bdpsoft - //Will allow download request to flow - if($app->response()->header('Content-Type')==='application/octet-stream'){ + + // don't render an empty response warning + // if we have specified another content-type + if($app->response()->header('Content-Type')!=='application/json'){ return; }