Skip to content

fix: actually compress body with gzip when enableCompression is true#152

Merged
asachs01 merged 1 commit intomainfrom
fix/gzip-compression-header
Mar 14, 2026
Merged

fix: actually compress body with gzip when enableCompression is true#152
asachs01 merged 1 commit intomainfrom
fix/gzip-compression-header

Conversation

@asachs01
Copy link
Collaborator

Fixes #151.

transformRequest set Content-Encoding: gzip but returned plain JSON.stringify(data), causing 500 errors on child entity endpoints that strictly validate the encoding header.

Fix: Use zlib.gzipSync to compress the body when enableCompression: true, matching the declared header.

Previously, transformRequest set Content-Encoding: gzip header but
returned plain JSON.stringify(data), causing 500 errors on child
entity endpoints (e.g. POST /Quotes/{id}/Items, POST /Tickets/{id}/Notes)
that strictly validate the encoding header.

Now uses zlib.gzipSync to compress the body when enableCompression is
true, matching the declared Content-Encoding.

Fixes #151
@asachs01 asachs01 merged commit 30482f9 into main Mar 14, 2026
0 of 5 checks passed
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.

fix: transformRequest sets Content-Encoding: gzip but never compresses body

1 participant