Use bucket path format

This commit is contained in:
Manohar Gupta 2026-05-10 14:26:08 +05:30
parent 2bf37de50b
commit 5de4294919

View file

@ -21,11 +21,11 @@ function getR2() {
return { return {
client: new S3Client({ client: new S3Client({
region: "auto", region: "auto",
endpoint, endpoint: `https://${accountId}.r2.cloudflarestorage.com`,
credentials: { accessKeyId, secretAccessKey: secretKey }, credentials: { accessKeyId, secretAccessKey: secretKey },
}), }),
bucket, bucket,
baseUrl: endpoint, baseUrl: `https://${accountId}.r2.cloudflarestorage.com/${bucket}`,
}; };
} }