mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
Merge pull request #272 from bknd-io/feat/media-add-body-max
feat: add media option to module to restrict body max size
This commit is contained in:
@@ -49,6 +49,8 @@ export function registerMedia(
|
||||
* @todo: add tests (bun tests won't work, need node native tests)
|
||||
*/
|
||||
export class StorageR2Adapter extends StorageAdapter {
|
||||
public keyPrefix: string = "";
|
||||
|
||||
constructor(private readonly bucket: R2Bucket) {
|
||||
super();
|
||||
}
|
||||
@@ -175,7 +177,7 @@ export class StorageR2Adapter extends StorageAdapter {
|
||||
}
|
||||
|
||||
protected getKey(key: string) {
|
||||
return key;
|
||||
return `${this.keyPrefix}/${key}`.replace(/^\/\//, "/");
|
||||
}
|
||||
|
||||
toJSON(secrets?: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user