Skip to content

Allow ReadAllLimit inputs at byte limit#15301

Open
immanuwell wants to merge 1 commit into
linkerd:mainfrom
immanuwell:fix-read-all-limit-boundary
Open

Allow ReadAllLimit inputs at byte limit#15301
immanuwell wants to merge 1 commit into
linkerd:mainfrom
immanuwell:fix-read-all-limit-boundary

Conversation

@immanuwell
Copy link
Copy Markdown
Contributor

Problem
ReadAllLimit was off by one: a body exactly at the configured cap returned limit reached. This can hit normal HTTP paths with 1MiB/10MiB/100MiB caps; no special infra magic needed, an exact-size request or response body does it.

Repro
Before this patch:

go test ./pkg/util -run TestReadAllLimit -count=1

fails on Allows input at limit with limit reached while reading: 5.

Fix
Read one byte past the cap, so exactly-cap bytes are ok and cap+1 still fails. tiny off-by-one cleanup, imo.

Validation

go test ./pkg/util -count=1
go test ./pkg/protohttp -count=1
go test ./controller/webhook -count=1
go test ./controller/heartbeat -count=1
go test ./pkg/version -count=1

Signed-off-by: immanuwell <pchpr.00@list.ru>
@immanuwell immanuwell requested a review from a team as a code owner May 21, 2026 04:44
@zaharidichev zaharidichev self-assigned this May 22, 2026
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.

2 participants