mirror of
https://github.com/grocy/grocy.git
synced 2025-08-14 17:54:40 +00:00
Finalize file API (references #58)
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user