Skip to content

Commit

Permalink
Header Set Code Fixed
Browse files Browse the repository at this point in the history
Some response types like BinaryFileResponse throws error with old header set style. It changed to more reliable way
  • Loading branch information
mahony0 authored Nov 3, 2021
1 parent ce31274 commit 40a0c30
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion classes/NoFLoCMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ class NoFLoCMiddleware
public function handle($request, Closure $next)
{
$response = $next($request);
$response->header('Permissions-Policy', 'interest-cohort=()');

$headers = [
'Permissions-Policy', 'interest-cohort=()',
];

foreach ($headers as $key => $value) {
$response->headers->set($key, $value);
}

return $response;
}
Expand Down

0 comments on commit 40a0c30

Please sign in to comment.