Skip to content

Commit 5e6ba37

Browse files
replace superagent with axios
1 parent d8144bc commit 5e6ba37

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/common/helper.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
const Joi = require('joi')
55
const _ = require('lodash')
66
const querystring = require('querystring')
7-
const request = require('superagent')
87
const constants = require('../../app-constants')
98
const models = require('../models')
109
const errors = require('./errors')
@@ -341,10 +340,10 @@ async function validatePhases (phases) {
341340
* @return {Promise} promise resolved to downloaded data
342341
*/
343342
async function downloadFromFileStack (url) {
344-
const res = await request.get(url)
343+
const res = await axios.get(url)
345344
return {
346-
data: res.body,
347-
mimetype: res.type
345+
data: res.data,
346+
mimetype: _.get(res, `headers['content-type']`, 'application/json')
348347
}
349348
}
350349

0 commit comments

Comments
 (0)