Skip to content

Commit e0f8d2c

Browse files
authored
fix copyObject in Bucket (#13)
1 parent e587673 commit e0f8d2c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Bucket.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,11 @@ export class Bucket {
448448
* @param destinationObjectKey The key of the destination object where the source object will be copied to.
449449
*/
450450
public async copyObject(sourceObjectKey: string, destinationObjectKey: string) {
451+
const copySource = `${this.name}/${sourceObjectKey}`;
451452
const result = await this.r2.send(
452453
new CopyObjectCommand({
453454
Bucket: this.name,
454-
CopySource: sourceObjectKey,
455+
CopySource: copySource,
455456
Key: destinationObjectKey,
456457
})
457458
);

0 commit comments

Comments
 (0)