diff --git a/src/Http/HttpKernel.php b/src/Http/HttpKernel.php index 2963c24..d749fd4 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, ?callable $psrInterfaceInjectedPipeline = null) + public function run(HttpRequestInterface $request, $send = true, ?callable $injectedPipeline = null) { try { $this->bundles = $this->registerBundles($request); @@ -122,10 +122,10 @@ public function run(HttpRequestInterface $request, $send = true, ?callable $psrI $this->getApplicationState()->commit(); } if ($send) { + if ($injectedPipeline !== null) { + $response = $injectedPipeline($this->getMasterFactory(), $response, $route->isPsrRoute()); + } if ($route->isPsrRoute()) { - if ($psrInterfaceInjectedPipeline !== null) { - $response = $psrInterfaceInjectedPipeline($this->getMasterFactory(), $response); - } $this->getMasterFactory()->createEmitter()->emit($response); } else { $response->send();