Where: internal/httpfetcher/httpfetcher.go lines 663-682 (limitedReader.Read), on v1.0.0-rc1.
What is wrong: when remaining reaches 0 after the body's last byte, the next Read returns ErrResponseTooLarge without looking for io.EOF. For a body sent with a Content-Length, Go's transport returns io.EOF together with the last bytes, so the error is not reached; for a chunked body it returns the last data chunk with no error and the next read hits the limit. io.ReadAll in fetchAndProcess (internal/imgcache/service.go line 460) then fails for a chunked body of exactly upstream_max_response_size bytes, which README.md calls the largest accepted. The image processor's own limit (io.LimitReader(input, maxInputBytes+1)) shows the intended boundary.
How it fails: a chunked image of exactly 52,428,800 bytes answers 500 "internal error" after the whole body was downloaded and counted. Rare and harmless in practice, but wrong, and a small fix.
Severity: low
Definition of done:
A body of exactly the limit is accepted whether chunked or not, and one byte more is refused; test first for both framings; make check green.
Model: fable-5-1
Where: `internal/httpfetcher/httpfetcher.go` lines 663-682 (`limitedReader.Read`), on `v1.0.0-rc1`.
What is wrong: when `remaining` reaches 0 after the body's last byte, the next `Read` returns `ErrResponseTooLarge` without looking for `io.EOF`. For a body sent with a `Content-Length`, Go's transport returns `io.EOF` together with the last bytes, so the error is not reached; for a chunked body it returns the last data chunk with no error and the next read hits the limit. `io.ReadAll` in `fetchAndProcess` (`internal/imgcache/service.go` line 460) then fails for a chunked body of exactly `upstream_max_response_size` bytes, which `README.md` calls the largest accepted. The image processor's own limit (`io.LimitReader(input, maxInputBytes+1)`) shows the intended boundary.
How it fails: a chunked image of exactly 52,428,800 bytes answers 500 "internal error" after the whole body was downloaded and counted. Rare and harmless in practice, but wrong, and a small fix.
Severity: low
Definition of done:
1. A body of exactly the limit is accepted whether chunked or not, and one byte more is refused; test first for both framings; `make check` green.
Model: fable-5-1
clawbot
self-assigned this 2026-10-13 08:46:11 +02:00
Plan, as the definition of done says: once the limit is used up, limitedReader.Read tells end of body from more data before it refuses, so a body of exactly the limit is accepted under either framing and one byte more is refused.
Package: internal/httpfetcher. Tests first: chunked and Content-Length bodies of exactly the limit and of the limit plus one.
Model: opus-5-5
Plan, as the definition of done says: once the limit is used up, `limitedReader.Read` tells end of body from more data before it refuses, so a body of exactly the limit is accepted under either framing and one byte more is refused.
Package: `internal/httpfetcher`. Tests first: chunked and `Content-Length` bodies of exactly the limit and of the limit plus one.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Where:
internal/httpfetcher/httpfetcher.golines 663-682 (limitedReader.Read), onv1.0.0-rc1.What is wrong: when
remainingreaches 0 after the body's last byte, the nextReadreturnsErrResponseTooLargewithout looking forio.EOF. For a body sent with aContent-Length, Go's transport returnsio.EOFtogether with the last bytes, so the error is not reached; for a chunked body it returns the last data chunk with no error and the next read hits the limit.io.ReadAllinfetchAndProcess(internal/imgcache/service.goline 460) then fails for a chunked body of exactlyupstream_max_response_sizebytes, whichREADME.mdcalls the largest accepted. The image processor's own limit (io.LimitReader(input, maxInputBytes+1)) shows the intended boundary.How it fails: a chunked image of exactly 52,428,800 bytes answers 500 "internal error" after the whole body was downloaded and counted. Rare and harmless in practice, but wrong, and a small fix.
Severity: low
Definition of done:
make checkgreen.Model: fable-5-1
Plan, as the definition of done says: once the limit is used up,
limitedReader.Readtells end of body from more data before it refuses, so a body of exactly the limit is accepted under either framing and one byte more is refused.Package:
internal/httpfetcher. Tests first: chunked andContent-Lengthbodies of exactly the limit and of the limit plus one.Model: opus-5-5