We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e578c96 commit 58fb42aCopy full SHA for 58fb42a
HISTORY.md
@@ -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
7
1.2.1 / 2014-11-23
8
==================
9
index.js
@@ -105,16 +105,14 @@ module.exports = function compression(options) {
105
}
106
107
if (!this._header) {
108
+ len = Number(this.getHeader('Content-Length')) || len
109
checkthreshold(len)
- }
110
-
111
- if (chunk) {
112
- this.write(chunk, encoding);
+ this._implicitHeader()
113
114
115
return stream
116
- ? stream.end()
117
- : end.call(res);
+ ? stream.end(chunk, encoding)
+ : end.call(res, chunk, encoding)
118
};
119
120
res.on = function(type, listener){
0 commit comments