diff --git a/src/js/client.js b/src/js/client.js index 61565fd19..629ad8614 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -1599,7 +1599,7 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N headers: { 'Content-Type': undefined } }; - head('/api/v1/apps/' + appId + '/download?file=' + filePath, config, function (error, data, status) { + head('/api/v1/apps/' + appId + '/download?file=' + encodeURIComponent(filePath), config, function (error, data, status) { if (error) return callback(error); if (status !== 200) return callback(new ClientError(status, data)); diff --git a/src/js/terminal.js b/src/js/terminal.js index 1f5814762..715860f0d 100644 --- a/src/js/terminal.js +++ b/src/js/terminal.js @@ -28,7 +28,7 @@ app.controller('TerminalController', ['$scope', '$timeout', '$location', 'Client downloadUrl: function () { if (!$scope.downloadFile.filePath) return ''; - var filePath = $scope.downloadFile.filePath.replace(/\/*\//g, '/'); + var filePath = encodeURIComponent($scope.downloadFile.filePath); return Client.apiOrigin + '/api/v1/apps/' + $scope.selected.value + '/download?file=' + filePath + '&access_token=' + Client.getToken(); },