fix: use per-request upload limit from DB and fix silent truncation

Reads max_upload_size_bytes from instance_settings per-request and
passes it to request.file() so Fastify kills the stream at the
admin's configured limit. Checks file.truncated to properly reject
files that exceed the limit instead of saving corrupted data.
This commit is contained in:
Jannis Braun
2026-03-23 02:22:15 +01:00
parent ee11408060
commit 5be2e73c8a
2 changed files with 14 additions and 9 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ async function main(): Promise<void> {
await app.register(multipart, {
limits: {
fileSize: config.maxUploadSize,
fileSize: 500 * 1024 * 1024, // 500MB hard ceiling — actual limit enforced per-request
},
});