'DENY', 'X-Content-Type-Options' => 'nosniff', 'X-XSS-Protection' => '1; mode=block', 'Referrer-Policy' => 'no-referrer-when-downgrade', ]; /** * Enforces some basic security headers on all responses returned by the software. * If a header has already been set in another location within the code it will be * skipped over here. * * @param (\Closure(mixed): \Illuminate\Http\Response) $next */ public function handle(Request $request, \Closure $next): mixed { $response = $next($request); foreach (static::$headers as $key => $value) { if (! $response->headers->has($key)) { $response->headers->set($key, $value); } } return $response; } }