Skip to content

Commit 58fb42a

Browse files
committed
Fix .end to only proxy to .end
fixes #23
1 parent e578c96 commit 58fb42a

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

HISTORY.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
unreleased
2+
==========
3+
4+
* Fix `.end` to only proxy to `.end`
5+
- Fixes an issue with Node.js 0.11.14
6+
17
1.2.1 / 2014-11-23
28
==================
39

index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,14 @@ module.exports = function compression(options) {
105105
}
106106

107107
if (!this._header) {
108+
len = Number(this.getHeader('Content-Length')) || len
108109
checkthreshold(len)
109-
}
110-
111-
if (chunk) {
112-
this.write(chunk, encoding);
110+
this._implicitHeader()
113111
}
114112

115113
return stream
116-
? stream.end()
117-
: end.call(res);
114+
? stream.end(chunk, encoding)
115+
: end.call(res, chunk, encoding)
118116
};
119117

120118
res.on = function(type, listener){

0 commit comments

Comments
 (0)