Skip to content

Commit 55a5aa6

Browse files
committed
fix: try to fix problem with http + disableStrictSSL
1 parent 8b8eee4 commit 55a5aa6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/util/request.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const _ = require("lodash");
22
const https = require("https");
3-
const http = require("http");
43
const fetch = require("node-fetch-h2");
54

65
class Request {
@@ -34,9 +33,8 @@ class Request {
3433
...(this.config.requestOptions || {}),
3534
};
3635

37-
if (disableStrictSSL) {
38-
const Agent = _.startsWith(url, "http://") ? http.Agent.bind(http) : https.Agent.bind(https);
39-
requestOptions.agent = new Agent({
36+
if (disableStrictSSL && !_.startsWith(url, "http://")) {
37+
requestOptions.agent = new https.Agent({
4038
rejectUnauthorized: false,
4139
});
4240
}

0 commit comments

Comments
 (0)