summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/HttpRequestService.ts
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-03-02 21:08:05 -0500
committerHazelnoot <acomputerdog@gmail.com>2025-03-21 12:37:06 -0400
commitf88430aebc1e5a0151375fe50458b099af18196f (patch)
tree3561ba351156725d7c5621da80106e497517e20f /packages/backend/src/core/HttpRequestService.ts
parentimplement ApResolver.secureResolve to use a provided object only if the autho... (diff)
downloadsharkey-f88430aebc1e5a0151375fe50458b099af18196f.tar.gz
sharkey-f88430aebc1e5a0151375fe50458b099af18196f.tar.bz2
sharkey-f88430aebc1e5a0151375fe50458b099af18196f.zip
add IObjectWithId type for APIs that work with objects required to have an ID.
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