You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(storage-r2): respect data.prefix in handleUpload path construction (#14485)
### What?
Aligns the `storage-r2` adapter’s prefix handling with `storage-s3`.
Previously, `storage-r2` always used the static prefix value from the
adapter config, ignoring any dynamic `data.prefix` set via hooks (e.g.,
in `beforeOperation`).
### Why?
In multi-tenant setups or other dynamic upload scenarios, developers may
set a custom `req.data.prefix` to determine where files should be stored
(e.g., under `<tenant>/<filename>`).
This behavior worked correctly with the S3 adapter but was ignored by
the R2 adapter, leading to inconsistent upload paths.
### How?
Updated `handleUpload.ts` in the R2 adapter to respect `data.prefix`
when present, falling back to the configured prefix otherwise.
Fixes#14483
0 commit comments