ISSUE DESCRIPTION Fail on HTTP Status 204 (No Content) Hello, I'm using Synadia Cloud…
- User
ISSUE DESCRIPTION
Fail on HTTP Status 204 (No Content) Hello,
I'm using Synadia Cloud which has a
DELETEAPI that returns a response with no body.code$ restish synadia delete-nats-user --help Deletes a NATS user from an account ## Argument Schema: { user-id: (string) } ## Responses 204/400/401/403/404 Response has no bodyIn this case, it's expected to have an empty body. Nevertheless,
restishfails with the error:codeERROR: Parse response error ERROR: Caught error: EOFHere is the full log:
code - Assistant
I’ll trace response decoding and existing tests first, then reproduce the EOF path with the project’s test conventions. I’ll make the smallest behavior change that treats an empty successful response—especially 204—as valid while preserving parsing errors for non-empty malformed bodies, run targeted and broader tests, inspect the diff, and submit only after verification.
- Assistant
The failure is in decompression, not content decoding:
gzip.NewReaderreturnsio.EOFimmediately when a 204 response has an empty wire body but retains aContent-Encoding: gzipheader. The normal empty-body check occurs only after decompression, so I’ll short-circuit statuses that are defined to have no payload (1xx, 204, 205, 304), plus HEAD responses, before constructing a decompressor. This keeps ordinary empty identity bodies valid and still rejects malformed compressed bodies when a payload is permitted. - Assistant
The targeted output, CLI, and content packages now pass. The fix deliberately checks protocol semantics before decompression, so a misleading compression header cannot turn a valid no-content response into an EOF; it does not weaken validation for compressed 200/4xx/etc. responses. I’ll run the full suite and inspect repository state next.
- Assistant
The direct reproduction now succeeds (
204withContent-Encoding: gzipand an empty body yieldsBody=nil, err=nil), and the temporary reproduction file was removed. The fullgo test ./...suite passes, andgit diff --checkreports no whitespace issues. The change is limited to response normalization and is ready to submit.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.