Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't override the user's debug configuration #23

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions jsonAPI/JsonApiMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down