In got.stream
, downloadProgress
fired when redirects happens. Every time redirect happens, the progress report from 0 (with total
of content-length
, undefined
if not any) to 1 instantly (with total
of 0). Related issue: electron/fiddle-core#59
downloadProgress
triggered every time redirect happens. This makes the progress percent from 0 to 1 and repeat until response.
downloadProgress
should report when it only receive a proper response, not redirect.
const { default: got } = require("got");
const dSteram = got.stream('https://github.com/electron/electron/releases/download/v29.1.5/electron-v29.1.5-win32-x64.zip');
dSteram.on('request', (req) => console.log("\n\nREQUEST ===========================", req.path));
dSteram.on('redirect', (req, resp) => {
console.log('====== REDIRECT ======');
console.log('FROM: ', req.url);
console.log('TO: ', resp.url.href);
});
dSteram.on('response', (response) => {
console.log('======= RESPONSE =======');
console.log('URL: ', response.url);
});
dSteram.on('downloadProgress', (progress) => {
console.log('====== PROGRESS ======');
console.log(progress);
});
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too