Finalize file API (references #58)

This commit is contained in:
Bernd Bestel
2018-09-30 22:16:33 +02:00
parent c675b534ef
commit e5fb609c8e
4 changed files with 95 additions and 1 deletions

View File

@@ -7,6 +7,14 @@ class JsonMiddleware extends BaseMiddleware
public function __invoke(\Slim\Http\Request $request, \Slim\Http\Response $response, callable $next)
{
$response = $next($request, $response);
return $response->withHeader('Content-Type', 'application/json');
if ($response->hasHeader('Content-Disposition'))
{
return $response;
}
else
{
return $response->withHeader('Content-Type', 'application/json');
}
}
}