Skip to content

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Oct 7, 2025

Issue #, if available:
aws/aws-sdk-js-v3#7408

Description of changes:

In the Node.js body length calculator, only call lstat and fstat if the input body is an actual instance of fs.ReadStream, and not merely possessing a .path or .fd property.

This would break an edge case where a user was expecting a body length calculation on a duck-typed FileReadStream that didn't extend the fs.ReadStream prototype, but that should be rarer than an accidental usage of the path property.

In such cases, the content length should be given by the caller in e.g. the ContentLength property, if available on the operation in question, or changed to extend the ReadStream prototype.

@kuhe kuhe requested a review from a team as a code owner October 7, 2025 15:44
@kuhe kuhe merged commit 300177f into main Oct 7, 2025
13 checks passed
@kuhe kuhe deleted the fix/body-len branch October 7, 2025 17:08
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

Successfully merging this pull request may close these issues.

3 participants