Skip to content

Commit e851806

Browse files
authored
Merge pull request #545 from 2hdddg/sanitize-auth-token
Sanitize authority token to improve connection error message
2 parents 5ae715d + b6f9b39 commit e851806

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ function driver (url, authToken, config = {}) {
228228
config.trust = trust
229229
}
230230

231+
// Sanitize authority token. Nicer error from server when a scheme is set.
232+
authToken = authToken || {}
233+
authToken.scheme = authToken.scheme || 'none'
234+
231235
if (routing) {
232236
return new RoutingDriver(
233237
ServerAddress.fromUrl(parsedUrl.hostAndPort),

0 commit comments

Comments
 (0)