diff --git a/lib/shared/utils.ts b/lib/shared/utils.ts index f9d34143..70abdabe 100755 --- a/lib/shared/utils.ts +++ b/lib/shared/utils.ts @@ -14,17 +14,14 @@ * limitations under the License. */ +import axios from 'axios'; import * as Bluebird from 'bluebird'; import * as _ from 'lodash'; -import * as request from 'request'; import * as tmp from 'tmp'; -import { promisify } from 'util'; import * as errors from './errors'; import * as settings from '../gui/app/models/settings'; -const getAsync = promisify(request.get); - export function isValidPercentage(percentage: any): boolean { return _.every([_.isNumber(percentage), percentage >= 0, percentage <= 100]); } @@ -55,7 +52,8 @@ export async function getConfig(): Promise<_.Dictionary> { const configUrl = (await settings.get('configUrl')) || 'https://balena.io/etcher/static/config.json'; - return (await getAsync({ url: configUrl, json: true })).body; + const response = await axios.get(configUrl, { responseType: 'json' }); + return response.data; } /** diff --git a/package.json b/package.json index 77ca67e2..6a7c4c0d 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,6 @@ "react-dom": "^16.8.5", "redux": "^4.0.5", "rendition": "^16.1.1", - "request": "^2.81.0", "resin-corvus": "^2.0.5", "semver": "^7.3.2", "simple-progress-webpack-plugin": "^1.1.2",