* Fix #843

* Updated test
This commit is contained in:
Tomas Della Vedova
2019-05-10 10:55:28 +02:00
committed by delvedor
parent 72b67fe4d7
commit 064807c5a9
2 changed files with 33 additions and 1 deletions

View File

@ -191,7 +191,8 @@ class Connection {
path: '',
href: url.href,
origin: url.origin,
port: url.port,
// https://github.com/elastic/elasticsearch-js/issues/843
port: url.port !== '' ? url.port : undefined,
headers: this.headers,
auth: !!url.username === true || !!url.password === true
? `${url.username}:${url.password}`