requester should resolve response.text if response is not json, better tests for csv export

This commit is contained in:
Matteo Pagliazzi
2016-01-28 11:30:53 +01:00
parent 6d38caf78b
commit 1369327c44
3 changed files with 17 additions and 4 deletions

View File

@@ -51,7 +51,8 @@ function _requestMaker (user, method, additionalSets) {
reject(parsedError);
}
resolve(response.body);
let contentType = response.headers['content-type'] || '';
resolve(contentType.indexOf('json') !== -1 ? response.body : response.text);
});
});
};