From 725b3fdd6546f147e170987af490b5c52136fc3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Sun, 5 Dec 2021 14:11:49 +0200 Subject: [PATCH] Fix HttpsProxyAgent creation and avoid deprecated call --- editors/code/src/net.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/editors/code/src/net.ts b/editors/code/src/net.ts index c295716add..bd1bb5f8a8 100644 --- a/editors/code/src/net.ts +++ b/editors/code/src/net.ts @@ -9,7 +9,6 @@ import * as zlib from "zlib"; import * as util from "util"; import * as path from "path"; import { log, assert } from "./util"; -import * as url from "url"; import * as https from "https"; import { ProxySettings } from "./config"; @@ -21,7 +20,7 @@ const REPO = "rust-analyzer"; function makeHttpAgent(proxy: string | null | undefined, options?: https.AgentOptions) { if (proxy) { - return new HttpsProxyAgent(proxy, { ...options, ...url.parse(proxy) }); + return new HttpsProxyAgent({ ...options, ...new URL(proxy) }); } else { return new https.Agent(options); }