'nosniff', 'X-Frame-Options' => 'SAMEORIGIN', 'Referrer-Policy' => 'strict-origin-when-cross-origin', 'Permissions-Policy' => 'camera=(), microphone=(), geolocation=()', ] as $header => $value) { if (! $response->headers->has($header)) { $response->headers->set($header, $value); } } if (config('security.csp.report_only') && str_contains((string) $response->headers->get('Content-Type'), 'text/html') && ! $response->headers->has('Content-Security-Policy-Report-Only')) { $response->headers->set('Content-Security-Policy-Report-Only', ContentSecurityPolicy::header()); } if ($request->isSecure() && config('security.hsts.enabled') && ! $response->headers->has('Strict-Transport-Security')) { $response->headers->set('Strict-Transport-Security', 'max-age='.(int) config('security.hsts.max_age')); } return $response; } }