Depending on the target host end
field of the stream.timings
object may undefined.
Output of the provided code to reproduce:
stream.timings.end (jsdelivr.com): 1689262466012
stream.timings.end (www.zenlayer.com): undefined
stream.timings.end (jsdelivr.com): 1689262466012
stream.timings.end (www.zenlayer.com): 1689262466012
import got from 'got';
const stream = got.stream('https://www.zenlayer.com:443/');
stream.on('data', (data) => {
stream.destroy(new Error());
});
stream.on('error', (...args) => {
console.log('stream.timings.end (www.zenlayer.com):', stream.timings.end);
});
const stream2 = got.stream('https://jsdelivr.com:443/');
stream2.on('data', (data) => {
stream2.destroy(new Error());
});
stream2.on('error', (...args) => {
console.log('stream.timings.end (jsdelivr.com):', stream2.timings.end);
});
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