Skip to content

Commit 5f85b5f

Browse files
authored
fix(middleware-sdk-s3): skip stream inspection if non-stream-like body (#6333)
1 parent e2ce217 commit 5f85b5f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/middleware-sdk-s3/src/throw-200-exceptions.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ export const throw200ExceptionsMiddleware =
4848
return result;
4949
}
5050

51+
const isSplittableStream =
52+
typeof sourceBody?.stream === "function" ||
53+
typeof sourceBody?.pipe === "function" ||
54+
typeof sourceBody?.tee === "function";
55+
56+
if (!isSplittableStream) {
57+
return result;
58+
}
59+
5160
let bodyCopy = sourceBody;
5261
let body = sourceBody;
5362

0 commit comments

Comments
 (0)