Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream.timings.end property may be undefined depending on host #2282

Open
2 tasks done
alexey-yarmosh opened this issue Jul 13, 2023 · 0 comments
Open
2 tasks done

stream.timings.end property may be undefined depending on host #2282

alexey-yarmosh opened this issue Jul 13, 2023 · 0 comments

Comments

@alexey-yarmosh
Copy link

Describe the bug

  • Node.js version: v18.16.0
  • OS & version: macOS 13.3.1 (22E261)

Actual behavior

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

Expected behavior

stream.timings.end (jsdelivr.com): 1689262466012
stream.timings.end (www.zenlayer.com): 1689262466012

Code to reproduce

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);
});

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant