Dont run csp locally

This commit is contained in:
Jonny Barnes 2022-08-05 20:35:49 +01:00
parent 9a27697984
commit 465c15f012
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8

View file

@ -4,6 +4,7 @@ namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
class CSPHeader
{
@ -16,6 +17,10 @@ class CSPHeader
*/
public function handle($request, Closure $next)
{
if (App::environment('local', 'development')) {
return $next($request);
}
// headers have to be single-line strings,
// so we concat multiple lines
// phpcs:disable Generic.Files.LineLength.TooLong