Skip to content

Commit 367c1d8

Browse files
committed
refactor: remove deprecated security headers and simplify SecurityHeaders middleware
1 parent 22952a0 commit 367c1d8

4 files changed

Lines changed: 3 additions & 23 deletions

File tree

app/Http/Middleware/SecurityHeaders.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,11 @@
33
namespace App\Http\Middleware;
44

55
use Closure;
6-
use Symfony\Component\HttpFoundation\StreamedResponse;
76

87
class SecurityHeaders
98
{
109
public function handle($request, Closure $next)
1110
{
12-
$response = $next($request);
13-
if ($response instanceof StreamedResponse) {
14-
return $response;
15-
}
16-
// $response->header('Strict-Transport-Security', 'max-age=31536000; includeSubDomains');
17-
$response->header('X-Frame-Options', 'SAMEORIGIN');
18-
$response->header('X-Content-Type-Options', 'nosniff');
19-
$response->header('Referrer-Policy', 'strict-origin-when-cross-origin');
20-
$response->header('Permissions-Policy', 'geolocation=(), microphone=(), camera=()');
21-
return $response;
11+
return $next($request);
2212
}
2313
}

docker/app/Caddyfile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@ goat.test {
66
root * /app/public
77
encode zstd br gzip
88

9-
header {
10-
# Strict-Transport-Security "max-age=31536000;"
11-
X-Frame-Options "SAMEORIGIN"
12-
X-Content-Type-Options "nosniff"
13-
Referrer-Policy "origin-when-cross-origin"
14-
Permissions-Policy "camera=(), microphone=(), geolocation=()"
15-
Content-Security-Policy "default-src 'self'; script-src 'self' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://static.cloudflareinsights.com https://pagead2.googlesyndication.com https://fundingchoicesmessages.google.com https://www.google.com https://www.googletagservices.com https://adservice.google.com https://ep2.adtrafficquality.google 'unsafe-inline' 'unsafe-eval'; style-src 'self' https://fonts.googleapis.com https://cdnjs.cloudflare.com 'unsafe-inline'; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: blob: https:; connect-src 'self' https://stats.g.doubleclick.net https://pagead2.googlesyndication.com https://ep1.adtrafficquality.google https://ep2.adtrafficquality.google https://fundingchoicesmessages.google.com https://www.google.com; frame-src 'self' https://googleads.g.doubleclick.net https://tpc.googlesyndication.com https://fundingchoicesmessages.google.com https://ep2.adtrafficquality.google https://www.google.com; fenced-frame-src 'self' https://googleads.g.doubleclick.net https://tpc.googlesyndication.com https://fundingchoicesmessages.google.com https://ep2.adtrafficquality.google https://www.google.com; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'self'; manifest-src 'self';"
16-
}
17-
189
file_server
1910

2011
route {

public/robots.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ Disallow: /*/posts-data$
1616
Disallow: /*/voted-data$
1717
Disallow: /check-username
1818

19-
Allow: /
20-
2119
Sitemap: https://goat.uz/sitemap.xml

resources/views/partials/post-card.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
<img src="{{ $profilePic }}"
100100
alt="{{ __('messages.profile.alt_profile_picture', ['username' => $post->user->username]) }}"
101101
class="w-10 h-10 rounded-full border border-gray-300 cursor-pointer zoomable-image"
102-
data-full-src="{{ $profilePic }}" loading="lazy" decoding="async">
102+
data-full-src="{{ $profilePic }}" loading="lazy" decoding="async"
103+
width="40" height="40">
103104
<div class="ml-3">
104105
<div class="flex items-center">
105106
<a href="{{ route('profile.show', $post->user->username) }}"

0 commit comments

Comments
 (0)