Skip security headers middleware when testing

This commit is contained in:
Marcus Moore 2023-02-02 18:37:35 -08:00
parent 9a0c66bd30
commit 0cefc7de15
No known key found for this signature in database

View file

@ -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);