Skip to content

fix: treat zstd as a binary content-encoding - #313

Merged
dougmoscrop merged 1 commit into
dougmoscrop:masterfrom
kulesy:zstd-binary-encoding
Sep 7, 2026
Merged

dougmoscrop merged 1 commit into
dougmoscrop:masterfrom
kulesy:zstd-binary-encoding

Conversation

@kulesy

@kulesy kulesy commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Closes #312

TL;DR Adds zstd to the content-encodings treated as binary in the AWS and Azure providers. Responses compressed with zstd are now base64-encoded like gzip and br ones, and every other encoding behaves exactly as before.

Pain: a response with Content-Encoding: zstd isn't recognised as binary, so its compressed bytes get stringified as utf-8 and the body arrives corrupted. Chrome and Safari now ask for zstd and koa-compress prefers it, so a stock Koa app behind this wrapper serves broken responses to modern browsers.

Solution: adds zstd to BINARY_ENCODINGS in both providers, along with a test for content-encoding detection, which had none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kulesy
kulesy marked this pull request as draft September 7, 2026 06:33
@kulesy
kulesy marked this pull request as ready for review September 7, 2026 07:47
@dougmoscrop
dougmoscrop merged commit ab1c416 into dougmoscrop:master Sep 7, 2026
1 check passed
@dougmoscrop

Copy link
Copy Markdown
Owner

Thanks, will cut a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zstd is missing from BINARY_ENCODINGS, so zstd-compressed responses get corrupted

2 participants