Skip to content

Commit f9c95f9

Browse files
Joe Podwysjpodwys
authored andcommitted
Update index.js
1 parent ed51c3a commit f9c95f9

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
@@ -95,24 +95,24 @@ function compression (options) {
9595

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

102102
this._implicitHeader()
103103
}
104104

105105
if (!stream) {
106-
return _end.call(this, chunk, encoding)
106+
return _end.call(this, chunk, encoding, cb)
107107
}
108108

109109
// mark ended
110110
ended = true
111111

112112
// write Buffer for Node.js 0.8
113113
return chunk
114-
? stream.end(new Buffer(chunk, encoding))
115-
: stream.end()
114+
? stream.end(new Buffer(chunk, encoding), cb)
115+
: stream.end(null, cb)
116116
}
117117

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

0 commit comments

Comments
 (0)