File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ Available values:
119
119
120
120
Default value: ` false ` .
121
121
122
- Enables built-in support of ` zstd ` compression algorithm (node ` >=22.15.0 ` ).
122
+ Enables built-in support of ` zstd ` compression algorithm (node: ` >=22.15.0 ` ).
123
123
Zstd compression is experimental (see [ node Zstd documentation] ( https://nodejs.org/api/zlib.html#zlibcreatezstdcompressoptions ) ).
124
124
125
125
Available values:
Original file line number Diff line number Diff line change @@ -127,6 +127,12 @@ exports = module.exports = internals.Compression = class {
127
127
128
128
enableBrotliCompression ( compressionOptions ) {
129
129
130
+ const defaults = {
131
+ params : {
132
+ [ Zlib . constants . BROTLI_PARAM_QUALITY ] : 4
133
+ }
134
+ } ;
135
+ compressionOptions = Hoek . applyToDefaults ( defaults , compressionOptions ) ;
130
136
this . decoders . br = ( options ) => Zlib . createBrotliDecompress ( { ...options , ...compressionOptions } ) ;
131
137
this . encoders . br = ( options ) => Zlib . createBrotliCompress ( { ...options , ...compressionOptions } ) ;
132
138
this . setPriority ( [ 'br' ] ) ;
You can’t perform that action at this time.
0 commit comments