diff --git a/src/Archive/Validators/HarValidator.ts b/src/Archive/Validators/HarValidator.ts index 3989a4f8..c4a489c1 100644 --- a/src/Archive/Validators/HarValidator.ts +++ b/src/Archive/Validators/HarValidator.ts @@ -47,7 +47,7 @@ export class HarValidator implements Validator { .map(this.parseEntry, this) .filter((item: string) => !!item); - const targets: string[] = [...new Set(urls).values()]; + const targets: string[] = [...new Set(urls)]; return targets.length !== 0; } diff --git a/src/RequestExecutor/Request.ts b/src/RequestExecutor/Request.ts index 86c0bf0b..317b71e6 100644 --- a/src/RequestExecutor/Request.ts +++ b/src/RequestExecutor/Request.ts @@ -123,16 +123,17 @@ export class Request { ...headers }; - this._headers = Object.fromEntries( - Object.entries(mergedHeaders).map( - ([field, value]: [string, string | string[]]) => [ - field, + this._headers = Object.entries(mergedHeaders).reduce( + (result, [field, value]: [string, string | string[]]) => { + result[field] = Array.isArray(value) && Request.SINGLE_VALUE_HEADERS.has(field.toLowerCase()) ? value.join(', ') - : value - ] - ) + : value; + + return result; + }, + {} ); }