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 request formatting, inspect existing tests and conventions, then implement the narrowest fix so truly empty successful responses (especially 204) do not enter a decoder that treats EOF as an error. I’ll run targeted and broader tests, review the diff, and only then submit.
- Assistant
The failure is in
internal/output.decodeBody: it calls the gzip decompressor before checking whether the response can have a body. An empty gzip stream can make decompressor construction returnio.EOF, even though HTTP 204 explicitly forbids a body. I’ll make normalization bypass content decoding for bodyless HTTP responses (1xx, 204, 205, 304, and HEAD), while preserving normal decoding and malformed-body errors for responses that are allowed to contain content. - Assistant
The targeted packages now pass. The environment initially lacked Go cache variables, so I reran with the repository’s available module cache and an explicit temporary build cache. I’ll additionally execute a small temporary reproduction using a 204 response carrying
Content-Encoding: gzip, then remove it, and run the full suite if practical. - Assistant
The direct reproduction now returns a normalized response with
body=<nil>and no error for an empty gzip-marked 204. The full repository test suite passes, the temporary reproduction file was removed, and the diff is limited to response normalization. The fix also covers HEAD, other 1xx responses, 205 Reset Content, and 304 Not Modified without changing behavior for body-permitted responses. I’m submitting the verified change now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.