fix stream leak on HEAD. Closes #91

master
TJ Holowaychuk 2013-11-15 10:49:28 -08:00
parent f4b7f279ea
commit f3a6f6ae39
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}