Updated test

This commit is contained in:
delvedor
2019-01-28 11:27:36 +01:00
parent 55fc8d7388
commit bd2755a302

View File

@ -573,3 +573,21 @@ test('Should throw if the protocol is not http or https', t => {
}
t.end()
})
// https://github.com/nodejs/node/commit/b961d9fd83
test('Should disallow two-byte characters in URL path', t => {
t.plan(1)
const connection = new Connection({
url: new URL('http://localhost:9200')
})
connection.request({
path: '/thisisinvalid' + encodeURIComponent('\uffe2'),
method: 'GET'
}, (err, res) => {
t.strictEqual(
err.message,
'ERR_UNESCAPED_CHARACTERS: /thisisinvalid\uffe2'
)
})
})