Technical notes on web development, DevOps, and AI integration.
1 article
Five slots times 10 MiB per request is a DoS invitation. A per-user rate limit plus multipart streaming cuts memory to roughly 1 MiB per request.
TL;DR: A rental form buffered whole uploads in RAM, letting one request hold 50 MiB and a hundred users 5 GiB. The fix pairs a 30-per-minute per-user rate limit with streaming via MaxBytesReader and a 1 MiB multipart memory window. Files stream to storage with per-slot caps and magic-byte checks, cutting memory to about 1 MiB per request.