Skip to content

Commit 92c76a1

Browse files
fix: asset download using axios [ZEND-5790] (#1953)
1 parent 5e1c191 commit 92c76a1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/tasks/download-assets.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ async function downloadAsset ({ url, directory, httpClient }) {
3232

3333
try {
3434
// download asset
35-
const assetRequest = await httpClient.get(url, { responseType: 'blob' })
35+
const assetRequest = await httpClient.get(url, {
36+
responseType: "stream",
37+
transformResponse: [(data) => data],
38+
})
3639

3740
// Wait for stream to be consumed before returning local file
3841
await streamPipeline(assetRequest.data, file)
@@ -89,7 +92,7 @@ export default function downloadAssets (options) {
8992

9093
return startingPromise
9194
.then(downloadAsset)
92-
.then((downLoadedFile) => {
95+
.then((_downLoadedFile) => {
9396
task.output = `${figures.tick} downloaded ${entityName} (${url})`
9497
successCount++
9598
})

0 commit comments

Comments
 (0)