Support for non-friendly chars in url username and password (#858)

* Support for non-friendly chars in url username and password
- Added auth option to Connection class
- Updated pool.addConnection

* Updated test
This commit is contained in:
Tomas Della Vedova
2019-05-20 11:09:33 -04:00
committed by delvedor
parent f8034c60bc
commit 32836b4f6c
4 changed files with 36 additions and 15 deletions

View File

@ -526,7 +526,8 @@ test('Url with auth', t => {
buildServer(handler, ({ port }, server) => {
const connection = new Connection({
url: new URL(`http://foo:bar@localhost:${port}`)
url: new URL(`http://foo:bar@localhost:${port}`),
auth: { username: 'foo', password: 'bar' }
})
connection.request({
path: '/hello',