From f3a6f6ae397ff0ab9dbbe750578f1945414b1aae Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Fri, 15 Nov 2013 10:49:28 -0800 Subject: [PATCH] fix stream leak on HEAD. Closes #91 --- lib/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/application.js b/lib/application.js index 3b3d845..c541f83 100644 --- a/lib/application.js +++ b/lib/application.js @@ -178,7 +178,7 @@ function *respond(next){ // Stream body if (body instanceof Stream) { if (!~body.listeners('error').indexOf(this.onerror)) body.on('error', this.onerror); - if (head) return res.end(); + if (head) return body.close(), res.end(); return body.pipe(res); }