f191f04d

By: Michael Lynch <git@mtlynch.io>

Parse image uploads as forms, stream only video

The image and video routes both used the streaming MultipartReader parser,
which exists to give video its 5 GB cap and reject oversized or unsupported
uploads before the body is read. Photos are capped at 50 MB, so those benefits
are marginal and the streaming loop is more code than the stdlib path.

Give each route its own parser: images use r.FormFile/r.FormValue, video keeps
the streaming parser. The image route now buffers the whole upload (bounded by
the 50 MB cap) before it can reject by type; the early-rejection property is
retained where it matters, on video. Re-point the early-rejection test to the
video route and cover image-route type rejection separately.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Suite timing

Time to Start Worker time Duration Time to finish
Config 2s 8s 8s 10s
Eval 8s 1m03s 1m03s 1m11s
Build 14s 8m10s 1m50s 2m04s
Suite 2s 9m22s 2m02s 2m04s

Timeline

0s10s20s30s40s50s1m1m10s1m20s1m30s1m40s1m50s2m