From 368bcf258f2db5e693453d863943689fe33d2b5d Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 14 Jul 2022 20:40:58 +0200 Subject: [PATCH] Fix failing tests --- src/headless/plugins/caps/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headless/plugins/caps/utils.js b/src/headless/plugins/caps/utils.js index 35f1b211e..8190fa52b 100644 --- a/src/headless/plugins/caps/utils.js +++ b/src/headless/plugins/caps/utils.js @@ -1,5 +1,5 @@ import { _converse, converse } from '@converse/headless/core.js'; -import { arrayBufferToBase64 } from '@converse/headless/utils/arraybuffer.js'; +import { arrayBufferToBase64, stringToArrayBuffer } from '@converse/headless/utils/arraybuffer.js'; const { Strophe, $build } = converse.env; @@ -21,7 +21,7 @@ async function generateVerificationString () { features.sort(); S = features.reduce((result, feature) => `${result}${feature}<`, S); - const ab = await crypto.subtle.digest('SHA-1', S); + const ab = await crypto.subtle.digest('SHA-1', stringToArrayBuffer(S)); return arrayBufferToBase64(ab); }