fix: remove false Content-Encoding gzip header causing 500 on child entity creates#150
Closed
shaank0 wants to merge 1 commit intowyre-technology:mainfrom
Closed
Conversation
…ld entity creates
The transformRequest in AutotaskClient and client-generator set
Content-Encoding: gzip on all POST/PUT/PATCH requests but only
JSON.stringify'd the data — never actually compressing it with zlib.
This caused the Autotask API to return 500 Internal Server Error on
child entity endpoints (POST /Quotes/{id}/Items, POST /Tickets/{id}/Notes)
which strictly validate Content-Encoding. Top-level endpoints like
POST /Quotes and POST /Opportunities were lenient and ignored the
mismatch, making the bug intermittent and hard to diagnose.
Fix: Remove the false Content-Encoding: gzip header entirely. Small
JSON API payloads don't benefit from request compression, and the
decompress option on the axios instance still handles response
decompression correctly.
Also improves ServerError messages to include error details from
the Autotask API response body (responseData.errors), which were
previously swallowed — making 500 errors show only the generic
"Internal Server Error" status text.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
asachs01
added a commit
that referenced
this pull request
Mar 15, 2026
The Autotask API often returns actionable error details in the `errors` array even for 500-level responses. Previously these were swallowed and only the generic status message was shown, making debugging difficult. Cherry-picked from shaank0/fix/remove-false-gzip-content-encoding (PR #150). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
Collaborator
|
Closing in favor of PR #154 which extracts the error message improvement rebased cleanly onto main. The gzip removal is not included since main already properly compresses when enableCompression=true. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Content-Encoding: gzipheader fromtransformRequestin bothAutotaskClient.tsandclient-generator.ts. The header claimed gzip encoding but the body was plainJSON.stringify()— never actually compressed. This caused the Autotask API to return 500 Internal Server Error on child entity endpoints (POST /Quotes/{id}/Items,POST /Tickets/{id}/Notes) which strictly validate the encoding. Top-level endpoints were lenient and ignored the mismatch.ServerErrormessages to include error details fromresponseData.errorsfor 500 responses. Previously, 500 errors showed only the generic "Internal Server Error" status text, making debugging extremely difficult.Root Cause
In
AutotaskClient.tsline ~414:The same bug existed in
client-generator.tsand is fixed there too.Impact
decompressaxios option for response decompression is unaffected — this only changes request encodingTest plan
npx tsc— compiles without errorsautotask-mcpshould update itsautotask-nodedependency to this fixRelated
wyre-technology/autotask-mcp#32— workaround that passesenableCompression: false; can be simplified after this fix🤖 Generated with Claude Code