The receiver's 1 MB body cap lives in the handler, not the middleware the other route groups use #173
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the independent review of #167 while verifying the premise that route's memory bound rests on. Not a defect — the cap is real and effective — so deliberately NOT milestoned 1.0.0.
/webhook/{uuid}carries onlyReceiverRateLimit(). Unlike the four page route groups, it has noMaxBodySizemiddleware. Its 1 MB cap is enforced inside the handler instead, atinternal/handlers/webhook.go:145-166, viaio.LimitReaderplus a length check.That works today and the reviewer confirmed it. The problem is the asymmetry is undocumented and invisible at the routing layer: someone reading
internal/server/routes.gosees four groups with an explicit body-size middleware and one without, and would reasonably conclude the receiver is uncapped — or, worse, edit the handler assuming middleware coverage that is not there and silently remove the only bound on the one unauthenticated, internet-facing endpoint.Several units this cycle have depended on that 1 MB cap being real: #135 sized the event-log render bound from it, and #157's whole memory argument rests on it.
Definition of done
Either:
MaxBodySizemiddleware the page groups use, so the cap is visible where every other route's cap is — checking first that this does not change the 413 semantics or the error the handler currently returns, since the receiver's response shape is part of its contract with senders; orinternal/server/routes.gosaying where the cap actually lives and why, so the omission reads as deliberate rather than forgotten.State which you chose and why. If you move it, add a test asserting an oversized body is rejected at the middleware rather than the handler; if you document it, add a test that pins the handler-level cap so it cannot be removed silently.
Implementation requirements
next, PR based onnext, single commit, title ending(closes #N).TODO.md(see #112).make bootstrapin a fresh clone before gating — browser assets are fetched at build time and not committed.make checkplus the Docker lint path with the cache defeated. All linting runs in Docker, never on the host.