Answer an oversized photo with the reason, not a 500

A file past the size limit makes the multipart stream itself throw, which
escaped the per-file catch and reached the error handler: the phone that just
sent a 35 MB photo got 'Something went wrong'. Catch the limit errors around the
part loop, say which limit was hit, and report it once rather than twice. Also
asserts that derivatives carry no EXIF while the Original keeps the uploaded
bytes.
This commit is contained in:
tanshu committed 2026-09-22 21:41:12 +05:30
1 parent 8af52a0f7d
commit a635c5a214
7 files changed
+234 -30

No files matched your search

+1
View File
@@ -98,6 +98,7 @@ export async function buildApp(options: AppOptions): Promise<FastifyInstance> {
sessionSecret: options.sessionSecret,
adminPasswordHash: options.adminPasswordHash,
secureCookies: options.secureCookies,
maxUploadBytes: options.config.limits.maxUploadBytes,
throttle: options.throttle,
});