From 5407ebad34f9f190ea7693d80dc8dff64c286a59 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Wed, 4 Dec 2024 11:13:41 +0100 Subject: [PATCH] Use allowH2 for both connections (microsoft/vscode#235410) --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 98ac23b..39e09bc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -597,8 +597,8 @@ export function createFetchPatch(params: ProxyAgentParams, originalFetch: typeof uri: proxyURL, allowH2, headers: proxyAuthorization ? { 'Proxy-Authorization': proxyAuthorization } : undefined, - ...(requestCA ? { requestTls: { ca: requestCA } } : {}), - ...(proxyCA ? { proxyTls: { ca: proxyCA } } : {}), + requestTls: requestCA ? { allowH2, ca: requestCA } : { allowH2 }, + proxyTls: proxyCA ? { allowH2, ca: proxyCA } : { allowH2 }, clientFactory: (origin: URL, opts: object): undici.Dispatcher => (new undici.Pool(origin, opts) as any).compose((dispatch: undici.Dispatcher['dispatch']) => { class ProxyAuthHandler extends undici.DecoratorHandler { private abort: ((err?: Error) => void) | undefined;