From e602f2efdaad1e677b3e1e2d69824a22367ff550 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 17 Jul 2024 23:55:39 +0900 Subject: [PATCH] move delete host --- .../backend/src/core/activitypub/ApRequestService.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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,