Skip to content

Trim whitespace before JSON sniffing. - #78

Merged
danmoz merged 1 commit into
masterfrom
opencode/issue38-20260905203831
Oct 15, 2026
Merged

danmoz merged 1 commit into
masterfrom
opencode/issue38-20260905203831

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Fixed. The sniffing guard in req_resp.go:61 now trims leading whitespace before checking for the JSON { byte, so a whitespace-prefixed HTTPJSON-REP envelope is correctly decoded instead of falling through to a bare 200 body. Added a test for this case; all tests, build, and vet pass.

Closes #38

New%20session%20-%202026-09-05T20%3A38%3A30.293Z
opencode session  |  github run

Co-authored-by: danmoz <danmoz@users.noreply.github.com>
@danmoz
danmoz force-pushed the opencode/issue38-20260905203831 branch from 5983139 to f9c3e96 Compare October 15, 2026 00:18
@danmoz
danmoz merged commit aacb548 into master Oct 15, 2026
5 of 6 checks passed
@danmoz
danmoz deleted the opencode/issue38-20260905203831 branch October 15, 2026 00:20
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.

HTTPJSON envelope sniffing only checks data[0] == '{'

1 participant