Skip to content

Commit f5e8143

Browse files
committed
fix: use createBrotliCompress, not createBrotliDecompress
1 parent 9c3260c commit f5e8143

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ function compression (options) {
177177
var preferredMethods = ['gzip']
178178
var acceptEncodingHeader = req.header('accept-encoding')
179179

180-
if (zlib.createBrotliDecompress) {
180+
if (zlib.createBrotliCompress) {
181181
methods.unshift('br')
182182
preferredMethods.unshift('br')
183183
}
@@ -199,7 +199,7 @@ function compression (options) {
199199
// compression stream
200200
debug('%s compression', method)
201201
switch (method) {
202-
case 'br': stream = zlib.createBrotliDecompress(opts); break
202+
case 'br': stream = zlib.createBrotliCompress(opts); break
203203
case 'gzip': stream = zlib.createGzip(opts); break
204204
case 'deflate': stream = zlib.createDeflate(opts); break
205205
}

0 commit comments

Comments
 (0)