diff --git a/packages/backend/src/core/activitypub/ApRequestService.ts b/packages/backend/src/core/activitypub/ApRequestService.ts index 352a45fcfc..0cae91316b 100644 --- a/packages/backend/src/core/activitypub/ApRequestService.ts +++ b/packages/backend/src/core/activitypub/ApRequestService.ts @@ -40,9 +40,6 @@ export async function createSignedPost(args: { level: string; key: PrivateKey; u ['(request-target)', 'date', 'host', 'digest'], ); - // node-fetch will generate this for us. if we keep 'Host', it won't change with redirects! - delete request.headers['Host']; - return { request, ...result, @@ -69,9 +66,6 @@ export async function createSignedGet(args: { level: string; key: PrivateKey; ur ['(request-target)', 'date', 'host', 'accept'], ); - // node-fetch will generate this for us. if we keep 'Host', it won't change with redirects! - delete request.headers['Host']; - return { request, ...result, @@ -109,6 +103,9 @@ export class ApRequestService { digest, }); + // node-fetch will generate this for us. if we keep 'Host', it won't change with redirects! + delete req.request.headers['Host']; + this.logger.debug('create signed post', { version: 'draft', level, @@ -140,6 +137,9 @@ export class ApRequestService { }, }); + // node-fetch will generate this for us. if we keep 'Host', it won't change with redirects! + delete req.request.headers['Host']; + this.logger.debug('create signed get', { version: 'draft', level,