diff options
| author | piuvas <mail@piuvas.net> | 2025-06-03 10:56:10 -0300 |
|---|---|---|
| committer | piuvas <mail@piuvas.net> | 2025-06-03 10:56:10 -0300 |
| commit | 1120ad19ae16969e552d895c72ee802f47d26c25 (patch) | |
| tree | aa4a13d4cf5c508a215d2faca56123eb44ac21aa /packages/backend/src/core/HttpRequestService.ts | |
| parent | check for whitespace in instance mutes. (diff) | |
| parent | merge: allow fragments in AP ID URLs - fixes polls (!1076) (diff) | |
| download | sharkey-1120ad19ae16969e552d895c72ee802f47d26c25.tar.gz sharkey-1120ad19ae16969e552d895c72ee802f47d26c25.tar.bz2 sharkey-1120ad19ae16969e552d895c72ee802f47d26c25.zip | |
merge develop and fix conflicts.
Diffstat (limited to 'packages/backend/src/core/HttpRequestService.ts')
| -rw-r--r-- | packages/backend/src/core/HttpRequestService.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/backend/src/core/HttpRequestService.ts b/packages/backend/src/core/HttpRequestService.ts index 2951691129..a0f2607ddc 100644 --- a/packages/backend/src/core/HttpRequestService.ts +++ b/packages/backend/src/core/HttpRequestService.ts @@ -235,7 +235,9 @@ export class HttpRequestService { } @bindThis - public async getActivityJson(url: string, isLocalAddressAllowed = false): Promise<IObjectWithId> { + public async getActivityJson(url: string, isLocalAddressAllowed = false, allowAnonymous = false): Promise<IObjectWithId> { + this.apUtilityService.assertApUrl(url); + const res = await this.send(url, { method: 'GET', headers: { @@ -253,7 +255,11 @@ export class HttpRequestService { // Make sure the object ID matches the final URL (which is where it actually exists). // The caller (ApResolverService) will verify the ID against the original / entry URL, which ensures that all three match. - this.apUtilityService.assertIdMatchesUrlAuthority(activity, res.url); + if (allowAnonymous && activity.id == null) { + activity.id = res.url; + } else { + this.apUtilityService.assertIdMatchesUrlAuthority(activity, res.url); + } return activity as IObjectWithId; } |