From c86b9b481639b31b5ace8af3286eeb90c45912bc Mon Sep 17 00:00:00 2001 From: ltrischberger Date: Fri, 4 Apr 2025 10:53:59 +0200 Subject: [PATCH] ACFIVE-47550 - allow injecting callable so we can use this to inject csp-policies --- src/Http/HttpKernel.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Http/HttpKernel.php b/src/Http/HttpKernel.php index 92af652..2963c24 100644 --- a/src/Http/HttpKernel.php +++ b/src/Http/HttpKernel.php @@ -48,7 +48,7 @@ public function __construct(MasterFactory $masterFactory) * @author mnoerenberg * @inheritdoc */ - public function run(HttpRequestInterface $request, $send = true) + public function run(HttpRequestInterface $request, $send = true, ?callable $psrInterfaceInjectedPipeline = null) { try { $this->bundles = $this->registerBundles($request); @@ -123,6 +123,9 @@ public function run(HttpRequestInterface $request, $send = true) } if ($send) { if ($route->isPsrRoute()) { + if ($psrInterfaceInjectedPipeline !== null) { + $response = $psrInterfaceInjectedPipeline($this->getMasterFactory(), $response); + } $this->getMasterFactory()->createEmitter()->emit($response); } else { $response->send();