Skip to content

Commit d7ec7e8

Browse files
committed
add TODOs
1 parent aefe24c commit d7ec7e8

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

lib/install.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ function place_binary(uri, targetDir, opts, callback) {
5656
process.env.npm_config_proxy;
5757
let agent;
5858
if (proxyUrl) {
59+
// TODO: replace with undici's ProxyAgent
5960
const { HttpsProxyAgent } = require('https-proxy-agent');
6061
agent = new HttpsProxyAgent(proxyUrl);
6162
log.http('download', 'proxy agent configured using: "%s"', proxyUrl);
6263
}
6364

65+
// TODO: use node's built-in fetch
6466
fetch(sanitized, { agent })
6567
.then((res) => {
6668
if (!res.ok) {

test/proxy-bcrypt.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ test('setup proxy server', (t) => {
4444
proxy.startServer({ port: proxyPort });
4545
process.env.https_proxy = process.env.http_proxy = proxyServer;
4646

47+
// TODO: replace with undici's ProxyAgent
4748
options.agent = new HttpsProxyAgent(proxyServer);
4849

4950
// make sure the download directory deleted then create an empty one
@@ -65,6 +66,7 @@ test('verify node fetch with a proxy successfully downloads bcrypt pre-built', (
6566
const url = 'https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-linux-x64-glibc.tar.gz';
6667

6768
async function getBcrypt() {
69+
// TODO: use node's built-in fetch
6870
const res = await fetch(url, options);
6971
if (res.status !== 200) {
7072
throw new Error(`fetch got error ${res.status}`);

0 commit comments

Comments
 (0)