Add headers to every response
You can use the after
application middleware, this is the method signature:
use Symfony\Component\HttpFoundation\Request;use Symfony\Component\HttpFoundation\Response;$app->after(function (Request $request, Response $response) { // ...});
This way you get the Response object that you can freely modify.