Fix error when node-fetch does redirects without a CA

This commit is contained in:
Evan Hahn 2020-09-11 20:17:41 -05:00 committed by Josh Perez
parent 3c9c581854
commit 638903b82c
1 changed files with 15 additions and 9 deletions

View File

@ -1,36 +1,42 @@
diff --git a/node_modules/node-fetch/lib/index.es.js b/node_modules/node-fetch/lib/index.es.js
index 37d022c..d3199df 100644
index 37d022c..22bc369 100644
--- a/node_modules/node-fetch/lib/index.es.js
+++ b/node_modules/node-fetch/lib/index.es.js
@@ -1398,6 +1398,7 @@ function fetch(url, opts) {
@@ -1398,6 +1398,9 @@ function fetch(url, opts) {
// build request object
const request = new Request(url, opts);
const options = getNodeRequestOptions(request);
+ options.ca = opts.ca;
+ if (opts && opts.ca) {
+ options.ca = opts.ca;
+ }
const send = (options.protocol === 'https:' ? https : http).request;
const signal = request.signal;
diff --git a/node_modules/node-fetch/lib/index.js b/node_modules/node-fetch/lib/index.js
index daa44bc..9edbbd3 100644
index daa44bc..4aae236 100644
--- a/node_modules/node-fetch/lib/index.js
+++ b/node_modules/node-fetch/lib/index.js
@@ -1402,6 +1402,7 @@ function fetch(url, opts) {
@@ -1402,6 +1402,9 @@ function fetch(url, opts) {
// build request object
const request = new Request(url, opts);
const options = getNodeRequestOptions(request);
+ options.ca = opts.ca;
+ if (opts && opts.ca) {
+ options.ca = opts.ca;
+ }
const send = (options.protocol === 'https:' ? https : http).request;
const signal = request.signal;
diff --git a/node_modules/node-fetch/lib/index.mjs b/node_modules/node-fetch/lib/index.mjs
index e571ea6..67399a0 100644
index e571ea6..7a50519 100644
--- a/node_modules/node-fetch/lib/index.mjs
+++ b/node_modules/node-fetch/lib/index.mjs
@@ -1396,6 +1396,7 @@ function fetch(url, opts) {
@@ -1396,6 +1396,9 @@ function fetch(url, opts) {
// build request object
const request = new Request(url, opts);
const options = getNodeRequestOptions(request);
+ options.ca = opts.ca;
+ if (opts && opts.ca) {
+ options.ca = opts.ca;
+ }
const send = (options.protocol === 'https:' ? https : http).request;
const signal = request.signal;