Files
webhooker/internal/middleware/middleware_test.go
clawbot d51cd0fd29
All checks were successful
check / check (push) Superseded by a newer commit; never tested
Enforce the body size limit before CSRF parses the form (closes #90)
CSRF ran before MaxBodySize, so the CSRF middleware parsed the form body
before any cap applied and an oversized request was read in full before
being rejected. MaxBodySize is now the first middleware in all four route
groups that parse forms, ahead of CSRF and RequireAuth.

An oversize request therefore gets 413 without the handler running and
without state changing, including the password-change route.

Note the ordering trade: an unauthenticated client now receives 413 rather
than an auth redirect on /user/{username}/password.
2026-08-11 14:37:38 +02:00

22 KiB