Add algorithm field for Misskey compatibility

This commit is contained in:
umonaca 2020-10-26 01:37:34 -04:00
parent 520f9b87e6
commit d7a3f8b765
2 changed files with 4 additions and 2 deletions

View File

@ -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);

View File

@ -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,