From d7a3f8b765d827b209741aac34844e105667ee3e Mon Sep 17 00:00:00 2001 From: umonaca Date: Mon, 26 Oct 2020 01:37:34 -0400 Subject: [PATCH] Add algorithm field for Misskey compatibility --- routes/inbox.js | 3 ++- updateFeeds.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/routes/inbox.js b/routes/inbox.js index f6221f6..d719e4f 100644 --- a/routes/inbox.js +++ b/routes/inbox.js @@ -27,7 +27,8 @@ function signAndSend(message, name, domain, req, res, targetDomain) { signer.end(); const signature = signer.sign(privkey); const signature_b64 = signature.toString('base64'); - let header = `keyId="https://${domain}/u/${name}",headers="(request-target) host date digest",signature="${signature_b64}"`; + const algorithm = 'rsa-sha256'; + let header = `keyId="https://${domain}/u/${name}",algorithm="${algorithm}",headers="(request-target) host date digest",signature="${signature_b64}"`; console.log('signature:',header); console.log('message:',message); diff --git a/updateFeeds.js b/updateFeeds.js index a8e5a6d..39c5aca 100644 --- a/updateFeeds.js +++ b/updateFeeds.js @@ -182,7 +182,8 @@ function signAndSend(message, name, domain, req, res, targetDomain, inbox) { signer.end(); const signature = signer.sign(privkey); const signature_b64 = signature.toString('base64'); - let header = `keyId="https://${domain}/u/${name}",headers="(request-target) host date digest",signature="${signature_b64}"`; + const algorithm = 'rsa-sha256'; + let header = `keyId="https://${domain}/u/${name}",algorithm="${algorithm}",headers="(request-target) host date digest",signature="${signature_b64}"`; //console.log('signature:',header); request({ url: inbox,