From b5aefc33af52e9da576917f52387f3eb778c3404 Mon Sep 17 00:00:00 2001 From: Patrick Remy Date: Fri, 23 Jul 2021 09:46:20 +0200 Subject: [PATCH] :bug: Fix #34, escape endpoint form data param --- src/fcm/index.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/fcm/index.js b/src/fcm/index.js index 408c097..7cf6440 100644 --- a/src/fcm/index.js +++ b/src/fcm/index.js @@ -17,15 +17,9 @@ async function registerFCM({ senderId, token }) { }, form : { authorized_entity : senderId, - endpoint : `${FCM_ENDPOINT}/${token}`, - encryption_key : keys.publicKey - .replace(/=/g, '') - .replace(/\+/g, '-') - .replace(/\//g, '_'), - encryption_auth : keys.authSecret - .replace(/=/g, '') - .replace(/\+/g, '-') - .replace(/\//g, '_'), + endpoint : escape(`${FCM_ENDPOINT}/${token}`), + encryption_key : keys.publicKey, + encryption_auth : keys.authSecret, }, }); return {