From 4f497d311a5b2044a36e5beb6ac6da1e4a0ba8e2 Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 24 Sep 2016 08:49:47 +0200 Subject: [PATCH] client/api: support Unicode passwords --- client/js/api.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/js/api.js b/client/js/api.js index e2932f2..535b880 100644 --- a/client/js/api.js +++ b/client/js/api.js @@ -84,7 +84,10 @@ class Api extends events.EventTarget { if (this.userName && this.userPassword) { req.auth( this.userName, - this.userPassword); + encodeURIComponent(this.userPassword) + .replace(/%([0-9A-F]{2})/g, (match, p1) => { + return String.fromCharCode('0x' + p1); + })); } } catch (e) { reject({