From b8970020b903d694d9feeec21e00f2c8e7411210 Mon Sep 17 00:00:00 2001 From: "Isaac (eartharoid)" Date: Sun, 6 Sep 2020 22:47:02 +0100 Subject: [PATCH] Update archive.js --- src/modules/archive.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/archive.js b/src/modules/archive.js index 5fb2878..a78bb7a 100644 --- a/src/modules/archive.js +++ b/src/modules/archive.js @@ -128,10 +128,13 @@ module.exports.export = (Ticket, channel) => new Promise((resolve, reject) => { data.messages[index] = message; }, () => { let endpoint = config.transcripts.web.server; + if (endpoint[endpoint.length - 1] === '/') endpoint = endpoint.slice(0, -1); + endpoint += `/${data.ticket.creator}/${data.ticket.channel}/?key=${process.env.ARCHIVES_KEY}`; - fetch(endpoint, { + + fetch(encodeURI(endpoint), { method: 'post', body: JSON.stringify(data), headers: { 'Content-Type': 'application/json' },