diff --git a/packages/backend/src/core/HttpRequestService.ts b/packages/backend/src/core/HttpRequestService.ts index 6787dab907..632e8f98ae 100644 --- a/packages/backend/src/core/HttpRequestService.ts +++ b/packages/backend/src/core/HttpRequestService.ts @@ -211,6 +211,7 @@ export class HttpRequestService { bodyTimeout: 10 * 1000, maxHeaderSize: 16364, // default maxResponseSize: 10 * 1024 * 1024, + maxRedirections: 3, connect: { timeout: 10 * 1000, // コネクションが確立するまでのタイムアウト maxCachedSessions: 300, // TLSセッションのキャッシュ数 https://github.com/nodejs/undici/blob/v5.14.0/lib/core/connect.js#L80 diff --git a/packages/backend/src/core/activitypub/ApRequestService.ts b/packages/backend/src/core/activitypub/ApRequestService.ts index fe487e8fd6..c686a7bfd8 100644 --- a/packages/backend/src/core/activitypub/ApRequestService.ts +++ b/packages/backend/src/core/activitypub/ApRequestService.ts @@ -37,7 +37,9 @@ export class ApRequestService { private userKeypairStoreService: UserKeypairStoreService, private httpRequestService: HttpRequestService, ) { - this.undiciFetcher = new UndiciFetcher(this.httpRequestService.getStandardUndiciFetcherOption()); + this.undiciFetcher = new UndiciFetcher(this.httpRequestService.getStandardUndiciFetcherOption({ + maxRedirections: 0, + })); } @bindThis diff --git a/packages/backend/src/core/activitypub/ApResolverService.ts b/packages/backend/src/core/activitypub/ApResolverService.ts index 94c053473e..2f8c97d375 100644 --- a/packages/backend/src/core/activitypub/ApResolverService.ts +++ b/packages/backend/src/core/activitypub/ApResolverService.ts @@ -35,7 +35,9 @@ export class Resolver { private recursionLimit = 100, ) { this.history = new Set(); - this.undiciFetcher = new UndiciFetcher(this.httpRequestService.getStandardUndiciFetcherOption()); + this.undiciFetcher = new UndiciFetcher(this.httpRequestService.getStandardUndiciFetcherOption({ + maxRedirections: 0, + })); } @bindThis