Add max redirects setting to test

This commit is contained in:
Gregory Schier 2017-08-16 10:08:29 -07:00
parent 9b6cb3fb5d
commit 9d5b896b00
3 changed files with 16 additions and 1 deletions

View File

@ -19,6 +19,7 @@ type BaseSettings = {
forceVerticalLayout: boolean,
autoHideMenuBar: boolean,
theme: string,
maxRedirects: number,
disableAnalyticsTracking: boolean,
pluginPath: string
};
@ -42,6 +43,7 @@ export function init (): BaseSettings {
httpProxy: '',
httpsProxy: '',
noProxy: '',
maxRedirects: -1,
proxyEnabled: false,
timeout: 0,
validateSSL: true,

View File

@ -132,7 +132,7 @@ export function _actuallySend (
// Set all the basic options
setOpt(Curl.option.FOLLOWLOCATION, settings.followRedirects);
setOpt(Curl.option.MAXREDIRS, 20);
setOpt(Curl.option.MAXREDIRS, settings.maxRedirects);
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

View File

@ -139,6 +139,19 @@ class General extends PureComponent {
</div>
</div>
<div className="form-control form-control--outlined">
<label>Maximum Redirects
<HelpTooltip className="space-left">
(-1 for unlimited)
</HelpTooltip>
<input type="number"
name="maxRedirects"
min={-1}
defaultValue={settings.maxRedirects}
onChange={this._handleUpdateSetting}/>
</label>
</div>
<div className="form-control form-control--outlined">
<label>Network Request Timeout
<HelpTooltip className="space-left">