Commit Graph
4 Commits
Author SHA1 Message Date
Coff0xc be8a79dd62 fix(server): cap insert_assets request bodies
POST /api/assets decoded with json.NewDecoder directly. A multipart
Content-Type skips the JSON body middleware, so that request was uncapped.
Decode through the shared limit first and answer 413 before touching the
database.
2026-11-26 11:40:32 +00:00
BaaRai 5fdf8eb075 fix(server): keep the MaxBytesError so a caller's 413 mapping still works
A handler that installs its own MaxBytesReader and then calls decode lost the 413: decode converted the error to a plain one and the middleware's limitedBody had been replaced. Return the original *http.MaxBytesError and update the cap test to errors.As.
2026-11-17 22:19:59 +01:00
protonmatter 186594ed3a Cap every non-multipart body and answer an oversized one with 413.
Handlers that decode JSON directly were still unbounded, and a body past the cap was reported as a bad request.
2026-11-17 15:57:43 -05:00
protonmatter 69bdd94d13 Cap JSON request bodies and bound how long a body may arrive.
decode stops at 32 MiB. ReadTimeout limits header and body arrival without cutting a handler that is already running.
2026-11-17 13:04:50 -05:00