Skip to content

Commit

Permalink
Check Stream global - fixes #304
Browse files Browse the repository at this point in the history
  • Loading branch information
perry-mitchell committed May 16, 2022
1 parent f4ff09e commit 1f9316f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/operations/putFileContents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ export async function putFileContents(
const headers: Headers = {
"Content-Type": "application/octet-stream"
};
if (typeof WEB === "undefined" && data instanceof Stream.Readable) {
if (
typeof WEB === "undefined" &&
typeof Stream !== "undefined" &&
typeof Stream?.Readable !== "undefined" &&
data instanceof Stream.Readable
) {
// Skip, no content-length
} else if (contentLength === false) {
// Skip, disabled
Expand Down

0 comments on commit 1f9316f

Please sign in to comment.