diff --git a/src/js/client.js b/src/js/client.js index 5b057b349..620d3b7e3 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -2407,7 +2407,12 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout if (download) { window.open(client.apiOrigin + '/api/v1/apps/' + appId + '/files/' + path + '?download=true&access_token=' + token); } else { - get('/api/v1/apps/' + appId + '/files/' + path, null, function (error, data, status) { + function responseHandler(data, headers, status) { + if (headers()['content-type'] && headers()['content-type'].indexOf('application/json') !== -1) return JSON.parse(data); + return data; + } + + get('/api/v1/apps/' + appId + '/files/' + path, { transformResponse: responseHandler }, function (error, data, status) { if (error) return callback(error); if (status !== 200) return callback(new ClientError(status, data));