mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 20:26:42 +00:00
Reorganize project part 2
This commit is contained in:
18
middleware/JsonMiddleware.php
Normal file
18
middleware/JsonMiddleware.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Middleware;
|
||||
|
||||
class JsonMiddleware
|
||||
{
|
||||
public function __construct(\Slim\Container $container) {
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
protected $container;
|
||||
|
||||
public function __invoke(\Slim\Http\Request $request, \Slim\Http\Response $response, callable $next)
|
||||
{
|
||||
$response = $next($request, $response, $next);
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user