Skip to content

Commit 1e623e9

Browse files
committed
feat(fetch): add zstandard decompression support
1 parent 674ae24 commit 1e623e9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/web/fetch/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,6 +2155,12 @@ async function httpNetworkFetch (
21552155
flush: zlib.constants.BROTLI_OPERATION_FLUSH,
21562156
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
21572157
}))
2158+
} else if (coding === 'zstd' && typeof zlib.createZstdDecompress === 'function') {
2159+
// Node.js v23.8.0+ and v22.15.0+ supports Zstandard
2160+
decoders.push(zlib.createZstdDecompress({
2161+
flush: zlib.constants.ZSTD_e_continue,
2162+
finishFlush: zlib.constants.ZSTD_e_end
2163+
}))
21582164
} else {
21592165
decoders.length = 0
21602166
break

0 commit comments

Comments
 (0)