fix(storage): prevent r2 upload failure by removing restricted header

Removed the `cf-create-bucket-if-missing` header from the multipart upload request in `js/storage/r2-s3.js`. This header triggers a 403 Forbidden error (and subsequent "Failed to fetch" due to CORS behavior) when using R2 API tokens with limited "Object Read & Write" permissions, as it requires bucket creation privileges. Bucket existence is now handled separately.
This commit is contained in:
google-labs-jules[bot] committed 2026-01-14 16:55:25 +00:00
1 parent c3179672b1
commit 2758081a2f
1 file changed
-10
-10
View File
@@ -258,16 +258,6 @@ export async function multipartUpload({
CacheControl: computeCacheControl(key),
});
createCommand.middlewareStack.add(
(next) => async (args) => {
if (args?.request?.headers) {
args.request.headers["cf-create-bucket-if-missing"] = "true";
}
return next(args);
},
{ step: "build" }
);
const { UploadId } = await s3.send(createCommand);
if (!UploadId) {