We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b18fa0 commit cdd2680Copy full SHA for cdd2680
src/utils/response.ts
@@ -177,7 +177,7 @@ export function isStream(data: any): data is Readable | ReadableStream {
177
return false;
178
}
179
// Node.js Readable Streams
180
- if (typeof data.pipe === "function" && typeof data.on === "function") {
+ if (typeof data.pipe === "function" && typeof data._read === "function") {
181
return true;
182
183
// Web Streams
@@ -227,7 +227,7 @@ export function sendStream(
227
228
// Node.js Readable streams
229
// https://nodejs.org/api/stream.html#readable-streams
230
- if ("pipe" in stream) {
+ if ("pipe" in stream && "_read" in stream) {
231
return new Promise<void>((resolve, reject) => {
232
stream.pipe(event.node.res);
233
stream.on("end", () => {
0 commit comments