File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,11 @@ function compression (options) {
80
80
return false
81
81
}
82
82
83
+ if ( ! cb && typeof encoding === 'function' ) {
84
+ cb = encoding
85
+ encoding = undefined
86
+ }
87
+
83
88
if ( ! this . _header ) {
84
89
this . _implicitHeader ( )
85
90
}
@@ -94,6 +99,11 @@ function compression (options) {
94
99
return false
95
100
}
96
101
102
+ if ( ! cb && typeof encoding === 'function' ) {
103
+ cb = encoding
104
+ encoding = undefined
105
+ }
106
+
97
107
if ( ! this . _header ) {
98
108
// estimate the length
99
109
if ( ! this . getHeader ( 'Content-Length' ) ) {
@@ -113,7 +123,7 @@ function compression (options) {
113
123
// write Buffer for Node.js 0.8
114
124
return chunk
115
125
? stream . end ( toBuffer ( chunk , encoding ) , encoding , cb )
116
- : stream . end ( )
126
+ : stream . end ( cb )
117
127
}
118
128
119
129
res . on = function on ( type , listener ) {
You can’t perform that action at this time.
0 commit comments