From 81d5ba0d5728c5f846b3b058ec34548eddbec685 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 19 Sep 2023 13:35:11 +0200 Subject: [PATCH] fix: avoid using potentially missing URL --- src/serviceProviders/activitypub.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/serviceProviders/activitypub.js b/src/serviceProviders/activitypub.js index b747a33..e2d9023 100644 --- a/src/serviceProviders/activitypub.js +++ b/src/serviceProviders/activitypub.js @@ -82,12 +82,12 @@ export const functions = { case 'Note': { claimData.profile.uri = proofData.result.attributedTo const personData = await fetcher.activitypub.fn({ url: proofData.result.attributedTo }, opts) - claimData.profile.display = `@${personData.preferredUsername}@${new URL(proofData.result.url).hostname}` + claimData.profile.display = `@${personData.preferredUsername}@${new URL(claimData.proof.request.uri).hostname}` break } case 'Person': - claimData.profile.display = `@${proofData.result.preferredUsername}@${new URL(proofData.result.url).hostname}` + claimData.profile.display = `@${proofData.result.preferredUsername}@${new URL(claimData.proof.request.uri).hostname}` break default: @@ -95,7 +95,7 @@ export const functions = { } // Attempt to fetch and process the instance's NodeInfo data - const nodeinfo = await _processNodeinfo(new URL(proofData.result.url).hostname) + const nodeinfo = await _processNodeinfo(new URL(claimData.proof.request.uri).hostname) if (nodeinfo) { claimData.about.name = nodeinfo.software.name claimData.about.id = nodeinfo.software.name