Skip to content

Commit

Permalink
fix: 'X-Frame-Options' to 'sameorigin' fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed Jan 4, 2024
1 parent ffac34f commit 0cf285b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions app/Http/Middleware/XFrameOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ public function handle(Request $request, Closure $next): Response
$response = $next($request);

if ($request->route()->getName() == 'embed') {
$response->header('Content-Security-Policy', "default-src 'self'; base-uri 'self'; block-all-mixed-content; frame-src data: blob: *; img-src 'self'; style-src 'unsafe-inline' *;");
}
return $response->header('Content-Security-Policy', "default-src 'self'; base-uri 'self'; block-all-mixed-content; frame-src data: blob: *; img-src 'self'; style-src 'unsafe-inline' *;");
} else {
$xframeOptions = 'SAMEORIGIN';

return $response;
return $response->header('X-Frame-Options', $xframeOptions);
}
}
}
1 change: 0 additions & 1 deletion resources/ops/docker/nginx/vhost.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ server {

client_max_body_size 200m;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";

Expand Down

0 comments on commit 0cf285b

Please sign in to comment.