From 0cefc7de1506b0ce8c468f48fa9572361d77d2ca Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 2 Feb 2023 18:37:35 -0800 Subject: [PATCH] Skip security headers middleware when testing --- app/Http/Middleware/SecurityHeaders.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Middleware/SecurityHeaders.php b/app/Http/Middleware/SecurityHeaders.php index 25f0461fcf..f3e7ea7cfa 100644 --- a/app/Http/Middleware/SecurityHeaders.php +++ b/app/Http/Middleware/SecurityHeaders.php @@ -3,6 +3,7 @@ namespace App\Http\Middleware; use Closure; +use Illuminate\Support\Facades\App; class SecurityHeaders { @@ -22,6 +23,10 @@ class SecurityHeaders public function handle($request, Closure $next) { + if (App::environment(['testing', 'testing-ci'])) { + return $next($request); + } + $this->removeUnwantedHeaders($this->unwantedHeaderList); $response = $next($request);