refactor: allow any streams with .pipe method
This commit is contained in:
parent
f061d1f8a9
commit
34104c9af3
2 changed files with 2 additions and 2 deletions
|
@ -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) {
|
||||
|
|
|
@ -133,7 +133,7 @@ module.exports = {
|
|||
}
|
||||
|
||||
// stream
|
||||
if (val instanceof Stream) {
|
||||
if ('function' == typeof val.pipe) {
|
||||
if (setType) this.type = 'bin';
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue