supabase-js: Missing ETag from S3 UploadPart response
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
Similar to https://github.com/aws/aws-sdk-js-v3/issues/5708
I’m trying to implement MultiPartUpload using the AWS S3 client, but the response object of UploadPart does not include the ETag property, though it’s included in the HTTP response. I suspect this may be due to ETag header not allowed in CORS settings (as mentioned in the above similar issue).
To Reproduce
const client = new S3Client({
forcePathStyle: true,
region: "eu-central-1",
endpoint: "https://....supabase.co/storage/v1/s3",
credentials: {
accessKeyId: "...",
secretAccessKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
sessionToken: userSession.access_token,
},
});
const uploadPartResponse = await client.send(
new UploadPartCommand({
Bucket: BUCKET_NAME,
Key: key,
PartNumber: partNumber,
UploadId: uploadId,
Body: chunk,
})
);
Expected behavior
ETag property should be present in uploadPartResponse object.
Screenshots
System information
- OS: macOS
- @supabase/supabase-js: ^2.48.1
- @aws-sdk/client-s3: ^3.733.0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 29 (9 by maintainers)
Yes, we have a PR open on the infra side finally, and should be merge fairly quickly! Thanks for your patience
Gotcha! Yes, i’m now fully on board with this. It’s definitely a CORS issue, I’m working for a solution
The test is passing locally regarding the Etag, as I was debugging it locally I couldn’t find anything wrong with it.
However, I had a couple of instances where cloudflare was changing the request to storage and I had to patch it with custom page rules.
after reading how they handle etags in headers it looks like they are issue, which can be disabled.
We use cloudflare in front of storage at the moment hence is very likely this is the issue.
I’ll send a patch sometimes next week 👍🏻
i had this issue on my local docker supabase instance from browser client.
I dug around in Kong etc… but could’nt figure out how to add the CORS setting…
Access-Control-Expose-Headers: Etag
I had to move over to AWS to get it working.
@madsborup are you working on this issue?