Skip to content

Commit 730538c

Browse files
xPawmarco-c
authored andcommitted
Require https-proxy-agent only when actually needed (#534)
1 parent 45607e4 commit 730538c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/web-push-lib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
const urlBase64 = require('urlsafe-base64');
44
const url = require('url');
55
const https = require('https');
6-
const HttpsProxyAgent = require('https-proxy-agent');
76

87
const WebPushError = require('./web-push-error.js');
98
const vapidHelper = require('./vapid-helper.js');
@@ -326,6 +325,7 @@ WebPushLib.prototype.sendNotification = function(subscription, payload, options)
326325
}
327326

328327
if (requestDetails.proxy) {
328+
const HttpsProxyAgent = require('https-proxy-agent'); // eslint-disable-line global-require
329329
httpsOptions.agent = new HttpsProxyAgent(requestDetails.proxy);
330330
}
331331

0 commit comments

Comments
 (0)