Do not rely on angular trying to parse everything in the response for filemanager GET
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user