Skip to content

Commit 6caa17d

Browse files
committed
Set custom security-header for the phpinfo page
1 parent b44f439 commit 6caa17d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

modules/admin/src/Controller/Config.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,13 @@ public function phpinfo(/** @scrutinizer ignore-unused */ Request $request): Res
180180
return $response;
181181
}
182182

183-
return new StreamedResponse('phpinfo');
183+
$response = new StreamedResponse('phpinfo');
184+
$response->headers->set(
185+
'Content-Security-Policy',
186+
"default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-ancestors 'self';",
187+
);
188+
189+
return $response;
184190
}
185191

186192
/**

0 commit comments

Comments
 (0)