only listen to stream errors if not already
This commit is contained in:
parent
1810977700
commit
cb60fb872a
1 changed files with 1 additions and 1 deletions
|
@ -195,7 +195,7 @@ function respond(next){
|
||||||
|
|
||||||
// Stream body
|
// Stream body
|
||||||
if (body instanceof Stream) {
|
if (body instanceof Stream) {
|
||||||
body.on('error', this.onerror.bind(this));
|
if (!~body.listeners('error').indexOf(this.onerror)) body.on('error', this.onerror);
|
||||||
if (head) return res.end();
|
if (head) return res.end();
|
||||||
return body.pipe(res);
|
return body.pipe(res);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue