Skip to content

Commit 1f9316f

Browse files
Check Stream global - fixes #304
1 parent f4ff09e commit 1f9316f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

source/operations/putFileContents.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ export async function putFileContents(
2828
const headers: Headers = {
2929
"Content-Type": "application/octet-stream"
3030
};
31-
if (typeof WEB === "undefined" && data instanceof Stream.Readable) {
31+
if (
32+
typeof WEB === "undefined" &&
33+
typeof Stream !== "undefined" &&
34+
typeof Stream?.Readable !== "undefined" &&
35+
data instanceof Stream.Readable
36+
) {
3237
// Skip, no content-length
3338
} else if (contentLength === false) {
3439
// Skip, disabled

0 commit comments

Comments
 (0)