mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-17 05:50:25 +01:00
fix: closes #13405, catch errors in ap.verify
This commit is contained in:
@@ -232,6 +232,8 @@ ActivityPub.verify = async (req) => {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Verify the signature string via public key
|
||||
try {
|
||||
// Break the signature apart
|
||||
let { keyId, headers, signature, algorithm, created, expires } = req.headers.signature.split(',').reduce((memo, cur) => {
|
||||
const split = cur.split('="');
|
||||
@@ -273,8 +275,6 @@ ActivityPub.verify = async (req) => {
|
||||
return memo;
|
||||
}, []).join('\n');
|
||||
|
||||
// Verify the signature string via public key
|
||||
try {
|
||||
// Retrieve public key from remote instance
|
||||
ActivityPub.helpers.log(`[activitypub/verify] Retrieving pubkey for ${keyId}`);
|
||||
const { publicKeyPem } = await ActivityPub.fetchPublicKey(keyId);
|
||||
|
||||
Reference in New Issue
Block a user