diff --git a/lib/application.js b/lib/application.js index c59a089..1ef6eef 100644 --- a/lib/application.js +++ b/lib/application.js @@ -215,7 +215,7 @@ function *respond(next){ } // Stream body - if (body instanceof Stream) { + if ('function' == typeof body.pipe) { if (!~body.listeners('error').indexOf(this.onerror)) body.on('error', this.onerror); if (head) { diff --git a/lib/response.js b/lib/response.js index a3ea91b..01be800 100644 --- a/lib/response.js +++ b/lib/response.js @@ -133,7 +133,7 @@ module.exports = { } // stream - if (val instanceof Stream) { + if ('function' == typeof val.pipe) { if (setType) this.type = 'bin'; return; }