Skip to content

Commit c24f5ca

Browse files
committed
feat: address comments 📝
1 parent 6d28443 commit c24f5ca

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Available values:
119119

120120
Default value: `false`.
121121

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`).
123123
Zstd compression is experimental (see [node Zstd documentation](https://nodejs.org/api/zlib.html#zlibcreatezstdcompressoptions)).
124124

125125
Available values:

lib/compression.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ exports = module.exports = internals.Compression = class {
127127

128128
enableBrotliCompression(compressionOptions) {
129129

130+
const defaults = {
131+
params: {
132+
[Zlib.constants.BROTLI_PARAM_QUALITY]: 4
133+
}
134+
};
135+
compressionOptions = Hoek.applyToDefaults(defaults, compressionOptions);
130136
this.decoders.br = (options) => Zlib.createBrotliDecompress({ ...options, ...compressionOptions });
131137
this.encoders.br = (options) => Zlib.createBrotliCompress({ ...options, ...compressionOptions });
132138
this.setPriority(['br']);

0 commit comments

Comments
 (0)