set maxRedirections (default 3, ApRequest/ApResolver: 0)

This commit is contained in:
tamaina 2023-01-06 14:03:36 +00:00
parent 50b98a92a8
commit cd13046c82
3 changed files with 7 additions and 2 deletions

View File

@ -211,6 +211,7 @@ export class HttpRequestService {
bodyTimeout: 10 * 1000, bodyTimeout: 10 * 1000,
maxHeaderSize: 16364, // default maxHeaderSize: 16364, // default
maxResponseSize: 10 * 1024 * 1024, maxResponseSize: 10 * 1024 * 1024,
maxRedirections: 3,
connect: { connect: {
timeout: 10 * 1000, // コネクションが確立するまでのタイムアウト timeout: 10 * 1000, // コネクションが確立するまでのタイムアウト
maxCachedSessions: 300, // TLSセッションのキャッシュ数 https://github.com/nodejs/undici/blob/v5.14.0/lib/core/connect.js#L80 maxCachedSessions: 300, // TLSセッションのキャッシュ数 https://github.com/nodejs/undici/blob/v5.14.0/lib/core/connect.js#L80

View File

@ -37,7 +37,9 @@ export class ApRequestService {
private userKeypairStoreService: UserKeypairStoreService, private userKeypairStoreService: UserKeypairStoreService,
private httpRequestService: HttpRequestService, private httpRequestService: HttpRequestService,
) { ) {
this.undiciFetcher = new UndiciFetcher(this.httpRequestService.getStandardUndiciFetcherOption()); this.undiciFetcher = new UndiciFetcher(this.httpRequestService.getStandardUndiciFetcherOption({
maxRedirections: 0,
}));
} }
@bindThis @bindThis

View File

@ -35,7 +35,9 @@ export class Resolver {
private recursionLimit = 100, private recursionLimit = 100,
) { ) {
this.history = new Set(); this.history = new Set();
this.undiciFetcher = new UndiciFetcher(this.httpRequestService.getStandardUndiciFetcherOption()); this.undiciFetcher = new UndiciFetcher(this.httpRequestService.getStandardUndiciFetcherOption({
maxRedirections: 0,
}));
} }
@bindThis @bindThis