1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00

fix: allow add to request agentOptions (#1506)

Follow up of https://github.com/verdaccio/verdaccio/pull/1332
Documented here https://github.com/verdaccio/website/pull/126
This commit is contained in:
Juan Picado @jotadeveloper 2019-10-03 08:23:08 +02:00 committed by GitHub
parent 52130704ec
commit 65d6a935b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -41,6 +41,7 @@ class ProxyStorage implements IProxy {
public timeout: number; public timeout: number;
public max_fails: number; public max_fails: number;
public fail_timeout: number; public fail_timeout: number;
public agent_options: any;
// FIXME: upname is assigned to each instance // FIXME: upname is assigned to each instance
// @ts-ignore // @ts-ignore
public upname: string; public upname: string;
@ -87,6 +88,7 @@ class ProxyStorage implements IProxy {
this.max_fails = Number(setConfig(this.config, 'max_fails', 2)); this.max_fails = Number(setConfig(this.config, 'max_fails', 2));
this.fail_timeout = parseInterval(setConfig(this.config, 'fail_timeout', '5m')); this.fail_timeout = parseInterval(setConfig(this.config, 'fail_timeout', '5m'));
this.strict_ssl = Boolean(setConfig(this.config, 'strict_ssl', true)); this.strict_ssl = Boolean(setConfig(this.config, 'strict_ssl', true));
this.agent_options = setConfig(this.config, 'agent_options', {});
} }
/** /**
@ -200,12 +202,12 @@ class ProxyStorage implements IProxy {
method: method, method: method,
headers: headers, headers: headers,
body: json, body: json,
// FIXME: ts complains ca cannot be undefined
proxy: this.proxy, proxy: this.proxy,
encoding: null, encoding: null,
gzip: true, gzip: true,
timeout: this.timeout, timeout: this.timeout,
strictSSL: this.strict_ssl, strictSSL: this.strict_ssl,
agentOptions: this.agent_options,
}; };
if (this.ca) { if (this.ca) {