feat: add media option to module to restrict body max size

updated media schema to enforce strict validation, introduced `options` for AppMedia, and added a key prefix feature for StorageR2Adapter to enhance flexibility and control.
This commit is contained in:
dswbx
2025-09-24 10:29:03 +02:00
parent 832eb6ac31
commit 7344b1cf3d
4 changed files with 11 additions and 3 deletions

View File

@@ -93,7 +93,10 @@ export class MediaController extends Controller {
},
);
const maxSize = this.getStorage().getConfig().body_max_size ?? Number.POSITIVE_INFINITY;
const maxSize =
this.media.options.body_max_size ??
this.getStorage().getConfig().body_max_size ??
Number.POSITIVE_INFINITY;
if (isDebug()) {
hono.post(