Skip to content

Node.js based forum software built for the modern web

feat: sign public key requests

Oplikofcd5447cd444
diff --git a/src/activitypub/index.js b/src/activitypub/index.js
index 098dff0eb7..6189bc575a 100644
--- a/src/activitypub/index.js
+++ b/src/activitypub/index.js
@@ -106,13 +106,9 @@ ActivityPub.getPrivateKey = async (type, id) => {
ActivityPub.fetchPublicKey = async (uri) => {
// Used for retrieving the public key from the passed-in keyId uri
- const { response, body } = await request.get(uri, {
- headers: {
- Accept: 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
- },
- });
+ const body = await ActivityPub.get('uid', 0, uri);
- if (!String(response.statusCode).startsWith('2') || !body.hasOwnProperty('publicKey')) {
+ if (!body.hasOwnProperty('publicKey')) {
throw new Error('[[error:activitypub.pubKey-not-found]]');
}