mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
fix: update key handling in StorageR2Adapter to conditionally prepend keyPrefix
- Modified getKey method to prepend keyPrefix only if it is not empty, ensuring correct key formatting.
This commit is contained in:
@@ -177,7 +177,10 @@ export class StorageR2Adapter extends StorageAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected getKey(key: string) {
|
protected getKey(key: string) {
|
||||||
return `${this.keyPrefix}/${key}`.replace(/^\/\//, "/");
|
if (this.keyPrefix.length > 0) {
|
||||||
|
return `${this.keyPrefix}/${key}`.replace(/^\/\//, "/");
|
||||||
|
}
|
||||||
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
toJSON(secrets?: boolean) {
|
toJSON(secrets?: boolean) {
|
||||||
|
|||||||
Reference in New Issue
Block a user