diff --git a/lib/application.js b/lib/application.js index 2763959..caa6956 100644 --- a/lib/application.js +++ b/lib/application.js @@ -210,7 +210,12 @@ function *respond(next){ // Stream body if (body instanceof Stream) { if (!~body.listeners('error').indexOf(this.onerror)) body.on('error', this.onerror); - if (head) return body.close(), res.end(); + + if (head) { + if (body.close) body.close(); + return res.end(); + } + return body.pipe(res); }