fix(polling): resolve mixed-content HTTP blocking and cache prevention for real-time polling

This commit is contained in:
Ray1111-aa
2026-10-29 14:40:11 +07:00
parent f7b92a1c71
commit b0469611d7
7 changed files with 17 additions and 9 deletions
@@ -204,7 +204,7 @@ class DashboardController extends Controller
'rejection_note' => $activity->rejection_note,
'recorded_at' => $activity->recorded_at ? $activity->recorded_at->format('H:i') . ' WIB' : null,
'validated_at' => $activity->validated_at ? $activity->validated_at->format('H:i') . ' WIB' : null,
]);
])->header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0');
}
/**
@@ -150,7 +150,7 @@ class GateInspectionController extends Controller
'count' => $pendingActivities->count(),
'items' => $items,
'html' => view('pg.partials.queue_cards', compact('pendingActivities', 'currentGuard', 'guards'))->render(),
]);
])->header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0');
}
/**
+5
View File
@@ -23,6 +23,11 @@ class AppServiceProvider extends ServiceProvider
\Carbon\Carbon::setLocale('id');
date_default_timezone_set(config('app.timezone', 'Asia/Jakarta'));
// Deteksi HTTPS dari Cloudflare Reverse Proxy / Tunnel
if (request()->header('x-forwarded-proto') === 'https' || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') || str_starts_with(config('app.url'), 'https://')) {
\Illuminate\Support\Facades\URL::forceScheme('https');
}
// Super Admin bypass: secara otomatis memiliki izin untuk semua ability
Gate::before(function ($user, $ability) {
if (in_array($user->role, ['super_admin', 'superadmin', 'admin'])) {