@elastic/elasticsearch
Advanced tools
Comparing version 5.6.17 to 5.6.18
@@ -38,2 +38,3 @@ /* | ||
this.headers = opts.headers || null | ||
this.auth = opts.auth || { username: null, password: null } | ||
this.deadCount = 0 | ||
@@ -184,2 +185,3 @@ this.resurrectTimeout = 0 | ||
const url = this.url | ||
const { username, password } = this.auth | ||
const request = { | ||
@@ -199,4 +201,4 @@ protocol: url.protocol, | ||
headers: this.headers, | ||
auth: !!url.username === true || !!url.password === true | ||
? `${url.username}:${url.password}` | ||
auth: username != null && password != null | ||
? `${username}:${password}` | ||
: undefined, | ||
@@ -230,3 +232,3 @@ agent: this.agent | ||
// Handles console.log and utils.inspect invocations. | ||
// We want to hide `agent` and `ssl` since they made | ||
// We want to hide `auth`, `agent` and `ssl` since they made | ||
// the logs very hard to read. The user can still | ||
@@ -233,0 +235,0 @@ // access them with `instance.agent` and `instance.ssl`. |
@@ -225,6 +225,16 @@ /* | ||
this._auth = { | ||
username: opts.url.username, | ||
password: opts.url.password | ||
username: decodeURIComponent(opts.url.username), | ||
password: decodeURIComponent(opts.url.password) | ||
} | ||
opts.auth = this._auth | ||
} | ||
if (this._auth != null) { | ||
if (opts.auth == null || (opts.auth.username == null && opts.auth.password == null)) { | ||
opts.auth = this._auth | ||
opts.url.username = this._auth.username | ||
opts.url.password = this._auth.password | ||
} | ||
} | ||
if (opts.ssl == null) opts.ssl = this._ssl | ||
@@ -234,9 +244,2 @@ if (opts.agent == null) opts.agent = this._agent | ||
const connection = new this.Connection(opts) | ||
if (connection.url.username === '' && | ||
connection.url.password === '' && | ||
this._auth != null) { | ||
connection.url.username = this._auth.username | ||
connection.url.password = this._auth.password | ||
} | ||
debug('Adding a new connection', connection) | ||
@@ -243,0 +246,0 @@ if (this.connections.has(connection.id)) { |
@@ -7,3 +7,3 @@ { | ||
"homepage": "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html", | ||
"version": "5.6.17", | ||
"version": "5.6.18", | ||
"keywords": [ | ||
@@ -10,0 +10,0 @@ "elasticsearch", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
652914
16949