Skip to content

Commit c86b9b4

Browse files
- allow injecting callable so we can use this to inject csp-policies
1 parent 948b25c commit c86b9b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Http/HttpKernel.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(MasterFactory $masterFactory)
4848
* @author mnoerenberg
4949
* @inheritdoc
5050
*/
51-
public function run(HttpRequestInterface $request, $send = true)
51+
public function run(HttpRequestInterface $request, $send = true, ?callable $psrInterfaceInjectedPipeline = null)
5252
{
5353
try {
5454
$this->bundles = $this->registerBundles($request);
@@ -123,6 +123,9 @@ public function run(HttpRequestInterface $request, $send = true)
123123
}
124124
if ($send) {
125125
if ($route->isPsrRoute()) {
126+
if ($psrInterfaceInjectedPipeline !== null) {
127+
$response = $psrInterfaceInjectedPipeline($this->getMasterFactory(), $response);
128+
}
126129
$this->getMasterFactory()->createEmitter()->emit($response);
127130
} else {
128131
$response->send();

0 commit comments

Comments
 (0)