diff --git a/lib/application.js b/lib/application.js index 9d2f11b..fc01474 100644 --- a/lib/application.js +++ b/lib/application.js @@ -195,7 +195,7 @@ function respond(next){ // Stream body 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(); return body.pipe(res); }