From 29d9af523c249a5ab58a328296a75fed0b342033 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Wed, 14 Feb 2024 10:37:46 +0100 Subject: [PATCH] Set `aes128gcm` as min es encoding --- ts/WoltLabSuite/Core/Notification/ServiceWorker.ts | 4 +++- .../files/js/WoltLabSuite/Core/Notification/ServiceWorker.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ts/WoltLabSuite/Core/Notification/ServiceWorker.ts b/ts/WoltLabSuite/Core/Notification/ServiceWorker.ts index 7292c5c5cd..ea3274b91d 100644 --- a/ts/WoltLabSuite/Core/Notification/ServiceWorker.ts +++ b/ts/WoltLabSuite/Core/Notification/ServiceWorker.ts @@ -36,7 +36,9 @@ class ServiceWorker { const key = subscription.getKey("p256dh"); const token = subscription.getKey("auth"); - const contentEncoding = (PushManager.supportedContentEncodings || ["aesgcm"])[0]; + // aes128gcm must be supported from browser + // @see https://w3c.github.io/push-api/#dom-pushmanager-supportedcontentencodings + const contentEncoding = (PushManager.supportedContentEncodings || ["aes128gcm"])[0]; try { await prepareRequest(this.registerUrl) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Notification/ServiceWorker.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Notification/ServiceWorker.js index c7e82d24b2..5549752fad 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Notification/ServiceWorker.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Notification/ServiceWorker.js @@ -34,7 +34,9 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax/Backend"], function (requi } const key = subscription.getKey("p256dh"); const token = subscription.getKey("auth"); - const contentEncoding = (PushManager.supportedContentEncodings || ["aesgcm"])[0]; + // aes128gcm must be supported from browser + // @see https://w3c.github.io/push-api/#dom-pushmanager-supportedcontentencodings + const contentEncoding = (PushManager.supportedContentEncodings || ["aes128gcm"])[0]; try { await (0, Backend_1.prepareRequest)(this.registerUrl) .post({ -- 2.20.1