Merge pull request #350 from jonnybarnes/fix_csp_issues_locally

Dont run csp locally
This commit is contained in:
Jonny Barnes 2022-08-05 21:01:48 +01:00 committed by GitHub
commit 081ac20f2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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