Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/middleware-sdk-s3/src/throw-200-exceptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export const throw200ExceptionsMiddleware =
return headStream(stream, MAX_BYTES_TO_INSPECT);
},
});
if (typeof bodyCopy?.destroy === "function") {
// discard partially-read Node.js Stream.
bodyCopy.destroy();
}

const bodyStringTail = config.utf8Encoder(bodyBytes.subarray(bodyBytes.length - 16));

// Throw on 200 response with empty body, legacy behavior allowlist.
Expand Down