[Kimchi-devel] [PATCH 5/9] Reflect the unicode conversion on token creation
Ramon Medeiros
ramonn at linux.vnet.ibm.com
Thu May 7 17:40:35 UTC 2015
In the backend, the token is created after a convertion of unicode, so,
the token passed by the ui will be forcely converted to unicode.
Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
---
ui/js/src/kimchi.api.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
index 5c36418..0f24a47 100644
--- a/ui/js/src/kimchi.api.js
+++ b/ui/js/src/kimchi.api.js
@@ -362,7 +362,7 @@ var kimchi = {
* contain = which is not safe in a URL query component.
* So remove it when needed as base64 can work well without it.
* */
- url += "&path=?token=" + kimchi.urlSafeB64Encode(vm).replace(/=*$/g, "");
+ url += "&path=?token=" + kimchi.urlSafeB64Encode(unescape(encodeURIComponent(vm))).replace(/=*$/g, "");
url += "&kimchi=" + location.port;
url += '&encrypt=1';
window.open(url);
@@ -394,7 +394,7 @@ var kimchi = {
* contain = which is not safe in a URL query component.
* So remove it when needed as base64 can work well without it.
* */
- url += "&token=" + kimchi.urlSafeB64Encode(vm).replace(/=*$/g, "");
+ url += "&token=" + kimchi.urlSafeB64Encode(unescape(encodeURIComponent(vm))).replace(/=*$/g, "");
url += "&kimchi=" + location.port;
url += '&encrypt=1';
window.open(url);
--
2.1.0
More information about the Kimchi-devel
mailing list