mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
Merge #10940
10940: minor: Fix HttpsProxyAgent creation and avoid deprecated call r=lnicola a=lnicola bors r+ Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
commit
b519a179b4
1 changed files with 1 additions and 2 deletions
|
@ -9,7 +9,6 @@ import * as zlib from "zlib";
|
||||||
import * as util from "util";
|
import * as util from "util";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import { log, assert } from "./util";
|
import { log, assert } from "./util";
|
||||||
import * as url from "url";
|
|
||||||
import * as https from "https";
|
import * as https from "https";
|
||||||
import { ProxySettings } from "./config";
|
import { ProxySettings } from "./config";
|
||||||
|
|
||||||
|
@ -21,7 +20,7 @@ const REPO = "rust-analyzer";
|
||||||
|
|
||||||
function makeHttpAgent(proxy: string | null | undefined, options?: https.AgentOptions) {
|
function makeHttpAgent(proxy: string | null | undefined, options?: https.AgentOptions) {
|
||||||
if (proxy) {
|
if (proxy) {
|
||||||
return new HttpsProxyAgent(proxy, { ...options, ...url.parse(proxy) });
|
return new HttpsProxyAgent({ ...options, ...new URL(proxy) });
|
||||||
} else {
|
} else {
|
||||||
return new https.Agent(options);
|
return new https.Agent(options);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue