fix: ingestion et service worker sont maintenant redémarré toutes les 6h

This commit is contained in:
Gwadaking
2026-04-14 01:42:43 -04:00
parent 9455fd8cb9
commit 2c41832d02
6 changed files with 25 additions and 5 deletions

View File

@@ -25,7 +25,11 @@ self.addEventListener('push', (event) => {
self.addEventListener('notificationclick', (event) => {
event.notification.close();
const targetUrl = event.notification.data?.url ?? '/';
const rawUrl = event.notification.data?.url ?? '/';
// N'autoriser que les URLs relatives ou du même domaine (protection open redirect)
const targetUrl = (rawUrl.startsWith('/') || rawUrl.startsWith(self.location.origin))
? rawUrl
: '/';
event.waitUntil(
clients.matchAll({ type: 'window', includeUncontrolled: true }).then((windowClients) => {