From dadd959f232a7dbdf7694303109d33257c7a2a20 Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Sat, 15 Sep 2018 12:19:12 -0700 Subject: [PATCH] Make GUIDs of Create and Note objects different Per #1. --- routes/api.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/routes/api.js b/routes/api.js index d7a38f0..43ddb2f 100644 --- a/routes/api.js +++ b/routes/api.js @@ -63,18 +63,19 @@ function signAndSend(message, name, domain, req, res, targetDomain, inbox) { } function createMessage(text, name, domain) { - const guid = crypto.randomBytes(16).toString('hex'); + const guidCreate = crypto.randomBytes(16).toString('hex'); + const guidNote = crypto.randomBytes(16).toString('hex'); let d = new Date(); return { '@context': 'https://www.w3.org/ns/activitystreams', - 'id': `https://${domain}/${guid}`, + 'id': `https://${domain}/${guidCreate}`, 'type': 'Create', 'actor': `https://${domain}/u/${name}`, 'object': { - 'id': `https://${domain}/${guid}`, + 'id': `https://${domain}/${guidNote}`, 'type': 'Note', 'published': d.toISOString(), 'attributedTo': `https://${domain}/u/${name}`,