File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ var vary = require('vary')
24
24
var zlib = require ( 'zlib' )
25
25
var ServerResponse = require ( 'http' ) . ServerResponse
26
26
27
+ var isOldRuntime = / ^ v 0 \. 8 \. / . test ( process . version )
28
+
27
29
/**
28
30
* Module exports.
29
31
*/
@@ -122,7 +124,7 @@ function compression (options) {
122
124
123
125
if ( chunk ) {
124
126
chunk = toBuffer ( chunk , encoding )
125
- if ( / ^ v 0 \. 8 \. / . test ( process . version ) && stream ) {
127
+ if ( isOldRuntime && stream ) {
126
128
encoding = callback
127
129
}
128
130
}
@@ -171,7 +173,7 @@ function compression (options) {
171
173
172
174
if ( chunk ) {
173
175
chunk = toBuffer ( chunk , encoding )
174
- if ( / ^ v 0 \. 8 \. / . test ( process . version ) && stream ) {
176
+ if ( isOldRuntime && stream ) {
175
177
encoding = callback
176
178
}
177
179
}
You can’t perform that action at this time.
0 commit comments