diff --git a/server/api/controller/user.js b/server/api/controller/user.js index 546d6885..4f5111d0 100644 --- a/server/api/controller/user.js +++ b/server/api/controller/user.js @@ -66,7 +66,9 @@ const userController = { } }, - // ADD EVENT + /** + * add event + */ async addEvent (req, res) { const body = req.body diff --git a/server/federation/helpers.js b/server/federation/helpers.js index 8c5004a9..e3745128 100644 --- a/server/federation/helpers.js +++ b/server/federation/helpers.js @@ -27,13 +27,10 @@ const Helpers = { async signAndSend (message, user, inbox) { // get the URI of the actor object and append 'inbox' to it const inboxUrl = new url.URL(inbox) - // const toPath = toOrigin.path + '/inbox' - // get the private key const privkey = user.rsa.privateKey const signer = crypto.createSign('sha256') const d = new Date() - const stringToSign = `(request-target): post ${inboxUrl.path}\nhost: ${inboxUrl.hostname}\ndate: ${d.toUTCString()}` - debug('Sign and send', user.username, inbox) + const stringToSign = `(request-target): post ${inboxUrl.pathname}\nhost: ${inboxUrl.hostname}\ndate: ${d.toUTCString()}` signer.update(stringToSign) signer.end() const signature = signer.sign(privkey)