Skip to content

Commit

Permalink
Fix CSP Always being Enabled unless in debug mode. (snipe#9543)
Browse files Browse the repository at this point in the history
  • Loading branch information
misilot committed May 5, 2021
1 parent ece627b commit 4e408cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Middleware/SecurityHeaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function handle($request, Closure $next)
// We have to exclude debug mode here because debugbar pulls from a CDN or two
// and it will break things.

if ((config('app.debug')!='true') || (config('app.enable_csp')=='true')) {
if ((config('app.debug')!='true') && (config('app.enable_csp')=='true')) {
$csp_policy[] = "default-src 'self'";
$csp_policy[] = "style-src 'self' 'unsafe-inline'";
$csp_policy[] = "script-src 'self' 'unsafe-inline' 'unsafe-eval'";
Expand Down

0 comments on commit 4e408cb

Please sign in to comment.