@@ -1340,15 +1340,23 @@ function buildContentRange (rangeStart, rangeEnd, fullLength) {
1340
1340
// interpreted as a zlib stream, otherwise it's interpreted as a
1341
1341
// raw deflate stream.
1342
1342
class InflateStream extends Transform {
1343
+ #zlibOptions
1344
+
1345
+ /** @param {zlib.ZlibOptions } [zlibOptions] */
1346
+ constructor ( zlibOptions ) {
1347
+ super ( )
1348
+ this . #zlibOptions = zlibOptions
1349
+ }
1350
+
1343
1351
_transform ( chunk , encoding , callback ) {
1344
1352
if ( ! this . _inflateStream ) {
1345
1353
if ( chunk . length === 0 ) {
1346
1354
callback ( )
1347
1355
return
1348
1356
}
1349
1357
this . _inflateStream = ( chunk [ 0 ] & 0x0F ) === 0x08
1350
- ? zlib . createInflate ( )
1351
- : zlib . createInflateRaw ( )
1358
+ ? zlib . createInflate ( this . #zlibOptions )
1359
+ : zlib . createInflateRaw ( this . #zlibOptions )
1352
1360
1353
1361
this . _inflateStream . on ( 'data' , this . push . bind ( this ) )
1354
1362
this . _inflateStream . on ( 'end' , ( ) => this . push ( null ) )
@@ -1367,8 +1375,12 @@ class InflateStream extends Transform {
1367
1375
}
1368
1376
}
1369
1377
1370
- function createInflate ( ) {
1371
- return new InflateStream ( )
1378
+ /**
1379
+ * @param {zlib.ZlibOptions } [zlibOptions]
1380
+ * @returns {InflateStream }
1381
+ */
1382
+ function createInflate ( zlibOptions ) {
1383
+ return new InflateStream ( zlibOptions )
1372
1384
}
1373
1385
1374
1386
/**
0 commit comments