summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/HttpRequestService.ts
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2025-03-23 13:45:13 +0000
committerdakkar <dakkar@thenautilus.net>2025-03-23 13:45:13 +0000
commitb1467989a555efd6e863fc85f3b04473617076f4 (patch)
tree737bd01c5dff1a6d068be65198e26193bbbb3395 /packages/backend/src/core/HttpRequestService.ts
parentmerge: Make confirm follow prompt not show up when cancelling a follow reques... (diff)
parentfix unit tests in activitypub.ts (diff)
downloadsharkey-b1467989a555efd6e863fc85f3b04473617076f4.tar.gz
sharkey-b1467989a555efd6e863fc85f3b04473617076f4.tar.bz2
sharkey-b1467989a555efd6e863fc85f3b04473617076f4.zip
merge: Accept announce activities (resolves #797 and #460) (!916)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/916 Closes #797 and #460 Approved-by: Marie <github@yuugi.dev> Approved-by: dakkar <dakkar@thenautilus.net>
Diffstat (limited to 'packages/backend/src/core/HttpRequestService.ts')
-rw-r--r--packages/backend/src/core/HttpRequestService.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/backend/src/core/HttpRequestService.ts b/packages/backend/src/core/HttpRequestService.ts
index 19992a7597..1aa62a9879 100644
--- a/packages/backend/src/core/HttpRequestService.ts
+++ b/packages/backend/src/core/HttpRequestService.ts
@@ -16,7 +16,7 @@ import type { Config } from '@/config.js';
import { StatusError } from '@/misc/status-error.js';
import { bindThis } from '@/decorators.js';
import { validateContentTypeSetAsActivityPub } from '@/core/activitypub/misc/validator.js';
-import { IObject } from '@/core/activitypub/type.js';
+import type { IObject, IObjectWithId } from '@/core/activitypub/type.js';
import { ApUtilityService } from './activitypub/ApUtilityService.js';
import type { Response } from 'node-fetch';
import type { URL } from 'node:url';
@@ -217,7 +217,7 @@ export class HttpRequestService {
}
@bindThis
- public async getActivityJson(url: string, isLocalAddressAllowed = false): Promise<IObject> {
+ public async getActivityJson(url: string, isLocalAddressAllowed = false): Promise<IObjectWithId> {
const res = await this.send(url, {
method: 'GET',
headers: {
@@ -237,7 +237,7 @@ export class HttpRequestService {
// The caller (ApResolverService) will verify the ID against the original / entry URL, which ensures that all three match.
this.apUtilityService.assertIdMatchesUrlAuthority(activity, res.url);
- return activity;
+ return activity as IObjectWithId;
}
@bindThis