add same-authority check between fetched note and summary url

This commit is contained in:
Hazelnoot 2025-05-05 10:37:04 -04:00
parent 633718ffe9
commit 1ac9625eea

View file

@ -297,7 +297,7 @@ export class UrlPreviewService {
// Finally, attempt a signed GET in case it's a direct link to an instance with authorized fetch. // Finally, attempt a signed GET in case it's a direct link to an instance with authorized fetch.
const instanceActor = await this.systemAccountService.getInstanceActor(); const instanceActor = await this.systemAccountService.getInstanceActor();
const remoteObject = await this.apRequestService.signedGet(summary.url, instanceActor).catch(() => null); const remoteObject = await this.apRequestService.signedGet(summary.url, instanceActor).catch(() => null);
if (remoteObject) { if (remoteObject && this.apUtilityService.haveSameAuthority(remoteObject.id, summary.url)) {
summary.activityPub = remoteObject.id; summary.activityPub = remoteObject.id;
return; return;
} }