fix(validator): bound HTTP fallback diagnostics - #1724
Open
oskarszoon wants to merge 1 commit into
Open
Conversation
Cap error-response reads before buffering and formatting. Preserve validator verdicts while quoting diagnostics and marking truncation. Close long responses without draining their remaining body.
Contributor
|
🤖 Claude Code Review Status: Complete Current Review: No blocking issues found. This is a clean, well-scoped defensive change.
Notes (non-blocking):
|
Contributor
Benchmark Comparison ReportBaseline: Current: Summary
All benchmark results (sec/op)
Threshold: >10% with p < 0.05 | Generated: 2026-09-11 15:29 UTC |
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.
The validator HTTP fallback buffers the whole non-200 response before reporting an error. Limit diagnostic reads to a 2 KiB prefix plus one byte to detect truncation, quote control characters, and mark truncated bodies. Preserve validation verdicts from response headers and the existing success behavior.
Responses still close on every successful HTTP exchange. Large error responses close without draining the remainder, which can prevent HTTP/1 connection reuse for those responses.
Validation: focused HTTP fallback tests pass, including under the race detector. Vet, staticcheck, and changed-code golangci-lint pass. The full validator suite reproduces an existing
TestValidate_RejectsGenuineUnspendableOutput/ff_varint_full_money_rangefee-policy assertion failure on both the original base and this branch. Local security scans also report existing Go toolchain and unchanged-file findings.CI is currently blocked by the test failures addressed in #1721. This branch will be rebased and checks rerun after that prerequisite merges.