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
Ah, structure changed - it's
internal/clinow, notcli.Assistant
Now let's find output.Normalize function.
Assistant
None of these seem to test gzip-encoded empty body with 204. Let's write a quick reproduce script.
Assistant
HOME appears to be
/restishitself. Let's set GOPATH properly.Assistant
Need to place script inside module path.
Assistant
Now add
bufioimport.Assistant
Now rerun the reproduction script.
Assistant
Fixed. Now let's test a normal gzip-encoded body with content still works.
Assistant
All cases behave correctly. Now clean up temp files and run existing test suite.
Assistant
Let's run broader test suite for cli package too, since it heavily uses this.
Assistant
All tests pass. Let's view the final diff.
Assistant
This looks good. Let me double check the
Peekreturningio.ErrUnexpectedEOFin some edge cases — actually for empty reader,bufio.Reader.Peekreturnsio.EOF, notio.ErrUnexpectedEOF. Let's verify by checking bufio docs / testing directly.Assistant
Confirmed
io.EOFis returned directly. The fix is solid.Assistant
Now let's go through the checklist explicitly.
Checklist review:
-
Reproduced the error — Yes. I wrote a script simulating an HTTP response with
Content-Encoding: gzipandStatusCode: 204with an empty body, passed throughoutput.Normalize, and confirmed it failed withdecompressing response: EOF, matching the exact error class reported in the issue (EOF during response parsing when body is empty but Content-Encoding is set). -
Confirmed the fix resolves the error — Yes. After the fix, the same reproduction case returns a valid
*output.Responsewith body and no error, instead of failing.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.