Skip to content

Commit

Permalink
fix(middleware-sdk-s3): skip stream inspection if non-stream-like body (
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe authored Aug 16, 2024
1 parent e2ce217 commit 5f85b5f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/middleware-sdk-s3/src/throw-200-exceptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ export const throw200ExceptionsMiddleware =
return result;
}

const isSplittableStream =
typeof sourceBody?.stream === "function" ||
typeof sourceBody?.pipe === "function" ||
typeof sourceBody?.tee === "function";

if (!isSplittableStream) {
return result;
}

let bodyCopy = sourceBody;
let body = sourceBody;

Expand Down

0 comments on commit 5f85b5f

Please sign in to comment.