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
1 changed files with 3 additions and 1 deletions

View File

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