From c2e8139c6e816bd012352c894470e0a5f2c68352 Mon Sep 17 00:00:00 2001 From: Abhinav Adduri Date: Fri, 14 Jul 2017 08:59:59 -0700 Subject: [PATCH] moved decodeURIComponent to fileReceiver --- frontend/src/download.js | 6 +++--- frontend/src/fileReceiver.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/download.js b/frontend/src/download.js index 4100996a..f16adf40 100644 --- a/frontend/src/download.js +++ b/frontend/src/download.js @@ -65,7 +65,7 @@ $(document).ready(function() { return; }) .then(([decrypted, fname]) => { - name.innerText = decodeURIComponent(fname); + name.innerText = fname; const dataView = new DataView(decrypted); const blob = new Blob([dataView]); const downloadUrl = URL.createObjectURL(blob); @@ -74,10 +74,10 @@ $(document).ready(function() { a.href = downloadUrl; if (window.navigator.msSaveBlob) { // if we are in microsoft edge or IE - window.navigator.msSaveBlob(blob, decodeURIComponent(fname)); + window.navigator.msSaveBlob(blob, fname); return; } - a.download = decodeURIComponent(fname); + a.download = fname; document.body.appendChild(a); a.click(); }) diff --git a/frontend/src/fileReceiver.js b/frontend/src/fileReceiver.js index 17b5393f..41fb37d4 100644 --- a/frontend/src/fileReceiver.js +++ b/frontend/src/fileReceiver.js @@ -110,7 +110,7 @@ class FileReceiver extends EventEmitter { resolve(decrypted); }), new Promise((resolve, reject) => { - resolve(fname); + resolve(decodeURIComponent(fname)); }) ]); });