Set `aes128gcm` as min es encoding
authorCyperghost <olaf_schmitz_1@t-online.de>
Wed, 14 Feb 2024 09:37:46 +0000 (10:37 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Mon, 19 Feb 2024 13:38:41 +0000 (14:38 +0100)
ts/WoltLabSuite/Core/Notification/ServiceWorker.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Notification/ServiceWorker.js

index 7292c5c5cdee7b8bdd313af7ae32c5e2bd67f75e..ea3274b91dc0853c8df582072027d2dfbf640053 100644 (file)
@@ -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)
index c7e82d24b2190ec93c71dab6e350a266c602c46f..5549752fade3d951c566f345aec238ecf543b87d 100644 (file)
@@ -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({