diff options
author | 2023-09-04 21:37:47 -0300 | |
---|---|---|
committer | 2023-09-04 17:37:47 -0700 | |
commit | f1afd5833874e64822560a834c3484b2aa993656 (patch) | |
tree | b62431b12410dfae2120332c9eb727bafbe79bd2 /src/http_client_async.zig | |
parent | 5f34c44ec6af175889e26aa5f42c817dd3de61c4 (diff) | |
download | bun-f1afd5833874e64822560a834c3484b2aa993656.tar.gz bun-f1afd5833874e64822560a834c3484b2aa993656.tar.zst bun-f1afd5833874e64822560a834c3484b2aa993656.zip |
fix zlib deflate on fetch (#4483)
* fix zlib deflate on fetch
* mention issue on test
* more tests
* oops
Diffstat (limited to 'src/http_client_async.zig')
-rw-r--r-- | src/http_client_async.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http_client_async.zig b/src/http_client_async.zig index 8a0e6548c..160a35716 100644 --- a/src/http_client_async.zig +++ b/src/http_client_async.zig @@ -1155,9 +1155,9 @@ pub const InternalState = struct { // TODO: add br support today we support gzip and deflate only // zlib.MAX_WBITS = 15 // to (de-)compress deflate format, use wbits = -zlib.MAX_WBITS - // to (de-)compress zlib format, use wbits = zlib.MAX_WBITS + // to (de-)compress deflate format with headers we use wbits = 0 (we can detect the first byte using 120) // to (de-)compress gzip format, use wbits = zlib.MAX_WBITS | 16 - .windowBits = if (this.encoding == Encoding.gzip) Zlib.MAX_WBITS | 16 else -Zlib.MAX_WBITS, + .windowBits = if (this.encoding == Encoding.gzip) Zlib.MAX_WBITS | 16 else (if (buffer.len > 1 and buffer[0] == 120) 0 else -Zlib.MAX_WBITS), }, ); this.zlib_reader = reader; |