Skip to content

Commit fae76d4

Browse files
author
Joe Podwys
committed
Update index.js
1 parent a48dfe9 commit fae76d4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,24 +94,24 @@ function compression(options) {
9494

9595
if (!this._header) {
9696
// estimate the length
97-
if (!this.getHeader('Content-Length'), cb) {
98-
length = chunkLength(chunk, encoding, cb)
97+
if (!this.getHeader('Content-Length')) {
98+
length = chunkLength(chunk, encoding)
9999
}
100100

101101
this._implicitHeader()
102102
}
103103

104104
if (!stream) {
105-
return end.call(this, chunk, encoding)
105+
return end.call(this, chunk, encoding, cb)
106106
}
107107

108108
// mark ended
109109
ended = true
110110

111111
// write Buffer for Node.js 0.8
112112
return chunk
113-
? stream.end(new Buffer(chunk, encoding))
114-
: stream.end()
113+
? stream.end(new Buffer(chunk, encoding), cb)
114+
: stream.end(null, cb)
115115
};
116116

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

0 commit comments

Comments
 (0)