diff --git a/app/__mocks__/node-libcurl.js b/app/__mocks__/node-libcurl.js index 7433f126b..b12149302 100644 --- a/app/__mocks__/node-libcurl.js +++ b/app/__mocks__/node-libcurl.js @@ -99,6 +99,7 @@ Curl.option = { HTTPPOST: 'HTTPPOST', INFILESIZE: 'INFILESIZE', KEYPASSWD: 'KEYPASSWD', + MAXREDIRS: 'MAXREDIRS', NETRC: 'NETRC', NOBODY: 'NOBODY', NOPROGRESS: 'NOPROGRESS', diff --git a/app/network/__tests__/network.test.js b/app/network/__tests__/network.test.js index 14133f76f..691dcdc55 100644 --- a/app/network/__tests__/network.test.js +++ b/app/network/__tests__/network.test.js @@ -71,6 +71,7 @@ describe('actuallySend()', () => { ACCEPT_ENCODING: '', COOKIEFILE: '', FOLLOWLOCATION: true, + MAXREDIRS: 20, HTTPHEADER: [ 'Content-Type: application/json', 'Expect: ', @@ -123,6 +124,7 @@ describe('actuallySend()', () => { ACCEPT_ENCODING: '', COOKIEFILE: '', FOLLOWLOCATION: true, + MAXREDIRS: 20, HTTPHEADER: [ 'Content-Type: application/x-www-form-urlencoded', 'Expect: ', @@ -200,6 +202,7 @@ describe('actuallySend()', () => { CUSTOMREQUEST: 'GET', ACCEPT_ENCODING: '', FOLLOWLOCATION: true, + MAXREDIRS: 20, HTTPHEADER: [ 'Content-Type: application/json', 'Expect: ', @@ -255,6 +258,7 @@ describe('actuallySend()', () => { CUSTOMREQUEST: 'POST', COOKIEFILE: '', FOLLOWLOCATION: true, + MAXREDIRS: 20, HTTPHEADER: [ 'Content-Type: application/octet-stream', 'Expect: ', @@ -310,6 +314,7 @@ describe('actuallySend()', () => { ACCEPT_ENCODING: '', COOKIEFILE: '', FOLLOWLOCATION: true, + MAXREDIRS: 20, HTTPHEADER: [ 'Content-Type: multipart/form-data', 'Expect: ', @@ -350,6 +355,7 @@ describe('actuallySend()', () => { ACCEPT_ENCODING: '', COOKIEFILE: '', FOLLOWLOCATION: true, + MAXREDIRS: 20, HTTPHEADER: ['content-type: '], NOPROGRESS: false, PROXY: '', @@ -383,6 +389,7 @@ describe('actuallySend()', () => { ACCEPT_ENCODING: '', COOKIEFILE: '', FOLLOWLOCATION: true, + MAXREDIRS: 20, HTTPHEADER: ['content-type: '], NOPROGRESS: false, PROXY: '', @@ -415,6 +422,7 @@ describe('actuallySend()', () => { ACCEPT_ENCODING: '', COOKIEFILE: '', FOLLOWLOCATION: true, + MAXREDIRS: 20, HTTPHEADER: ['content-type: '], NOPROGRESS: false, PROXY: '', @@ -448,6 +456,7 @@ describe('actuallySend()', () => { ACCEPT_ENCODING: '', COOKIEFILE: '', FOLLOWLOCATION: true, + MAXREDIRS: 20, HTTPHEADER: ['content-type: '], NOPROGRESS: false, PROXY: '', diff --git a/app/network/network.js b/app/network/network.js index be34aa76e..e3095bb78 100644 --- a/app/network/network.js +++ b/app/network/network.js @@ -132,6 +132,7 @@ export function _actuallySend ( // Set all the basic options setOpt(Curl.option.FOLLOWLOCATION, settings.followRedirects); + setOpt(Curl.option.MAXREDIRS, 20); setOpt(Curl.option.TIMEOUT_MS, settings.timeout); // 0 for no timeout setOpt(Curl.option.VERBOSE, true); // True so debug function works setOpt(Curl.option.NOPROGRESS, false); // False so progress function works diff --git a/flow-typed/node-libcurl.js b/flow-typed/node-libcurl.js index 0dc69985f..16d3f5bc1 100644 --- a/flow-typed/node-libcurl.js +++ b/flow-typed/node-libcurl.js @@ -14,6 +14,7 @@ declare class Curl { HTTPPOST: number, INFILESIZE: number, KEYPASSWD: number, + MAXREDIRS: number, NETRC: number, NOBODY: number, NOPROGRESS: number,