From 7b67e1c521f0d30dfb7b6937f8556e23a17adb6f Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 14 Apr 2021 15:24:37 -0700 Subject: [PATCH] Firebase public relay fix. --- firebase.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firebase.js b/firebase.js index 2bbdabb9..3ab9a12c 100644 --- a/firebase.js +++ b/firebase.js @@ -327,13 +327,13 @@ module.exports.CreateFirebaseRelay = function (parent, url, key) { parent.debug('email', 'Firebase-sendToDevice-httpPost'); if ((node == null) || (typeof node.pmt != 'string')) return; - obj.log('sendToDevice, node:' + node._id + ', payload: ' + JSON.stringify(payload) + ', options: ' + JSON.stringify(options)); - const querydata = querystring.stringify({ 'msg': JSON.stringify({ pmt: node.pmt, payload: payload, options: options }) }); - // Fill in the server agent cert hash if (payload.data == null) { payload.data = {}; } if (payload.data.shash == null) { payload.data.shash = parent.webserver.agentCertificateHashBase64; } // Add the server agent hash, new Android agents will reject notifications that don't have this. + obj.log('sendToDevice, node:' + node._id + ', payload: ' + JSON.stringify(payload) + ', options: ' + JSON.stringify(options)); + const querydata = querystring.stringify({ 'msg': JSON.stringify({ pmt: node.pmt, payload: payload, options: options }) }); + // Send the message to the relay const httpOptions = { hostname: relayUrl.hostname,