From 67199772cd987b148b6fc81238c6d75821326c42 Mon Sep 17 00:00:00 2001 From: Alexey Lunin <alexey.lunin@vereign.com> Date: Fri, 15 Mar 2019 12:24:58 +0400 Subject: [PATCH] Encode file paths --- javascript/src/iframe/wopiapi-iframe.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/javascript/src/iframe/wopiapi-iframe.js b/javascript/src/iframe/wopiapi-iframe.js index c009f9e..24283fc 100644 --- a/javascript/src/iframe/wopiapi-iframe.js +++ b/javascript/src/iframe/wopiapi-iframe.js @@ -12,7 +12,7 @@ WopiAPI.prototype.getPassports = function (fileID) { uuid, token, deviceHash, - fileID + fileID: encodeURI(fileID) } }; @@ -22,6 +22,7 @@ WopiAPI.prototype.getPassports = function (fileID) { WopiAPI.prototype.putDocument = function (path, accessToken, file) { const { publicKey, uuid, token, deviceHash } = window.viamApi.getConfig().headers; path = path[0] === "/" ? path : `/${path}`; + path = encodeURI(path); const requestConfig = { url: `${window.WOPI_URL}files${path}/contents`, method: 'POST', -- GitLab