Skip to content

Commit 7dfcbe6

Browse files
committed
chore: adjust code required by dep update
1 parent 8eef351 commit 7dfcbe6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/request/src/request.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
const http = require('http');
2525
const https = require('https');
26-
const HttpsProxyAgent = require('https-proxy-agent');
27-
const HttpProxyAgent = require('http-proxy-agent');
26+
const { HttpsProxyAgent } = require('https-proxy-agent');
27+
const { HttpProxyAgent } = require('http-proxy-agent');
2828
const querystring = require('querystring');
2929
const url = require('url');
3030

packages/utils/src/downloader.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
const fs = require('fs');
2525
const http = require('http');
2626
const https = require('https');
27-
const HttpsProxyAgent = require('https-proxy-agent');
27+
const { HttpsProxyAgent } = require('https-proxy-agent');
2828
const path = require('path');
2929
const tar = require('tar');
3030
const url = require('url');
@@ -53,7 +53,10 @@ class Downloader {
5353
process.env.HTTPS_PROXY;
5454
}
5555
if (this.proxy) {
56-
this.agent = new HttpsProxyAgent(this.proxy);
56+
const proxy = this.proxy.startsWith('https://')
57+
? this.proxy
58+
: `https://${this.proxy}`;
59+
this.agent = new HttpsProxyAgent(proxy);
5760
}
5861
}
5962

0 commit comments

Comments
 (0)