client/api: support Unicode passwords

This commit is contained in:
rr- 2016-09-24 08:49:47 +02:00
parent 01fadd8f8c
commit 4f497d311a
1 changed files with 4 additions and 1 deletions

View File

@ -84,7 +84,10 @@ class Api extends events.EventTarget {
if (this.userName && this.userPassword) { if (this.userName && this.userPassword) {
req.auth( req.auth(
this.userName, this.userName,
this.userPassword); encodeURIComponent(this.userPassword)
.replace(/%([0-9A-F]{2})/g, (match, p1) => {
return String.fromCharCode('0x' + p1);
}));
} }
} catch (e) { } catch (e) {
reject({ reject({