thank you for your support to this gem. am asking in the hopes that some of you may know a quick answer, by virtue of experience. If not, I will continue to dig in the documentation. (Am happy to make PRs to the documentation of that would help).
I am trying to understand how to set up a bucket for CORS. The example used in the documentation is for Amazon S3 bucket, but I would like to use a Google bucket instead, so I’m guessing I have to tweak the following to suit Google?
Settting up CORS for Amazon S3 bucket:
<?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>https://my-app.com</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>POST</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> <AllowedHeader>Authorization</AllowedHeader> <AllowedHeader>x-amz-date</AllowedHeader> <------- What is this? <AllowedHeader>x-amz-content-sha256</AllowedHeader> <--- What is this? <AllowedHeader>content-type</AllowedHeader> <ExposeHeader>ETag</ExposeHeader> </CORSRule> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <MaxAgeSeconds>3000</MaxAgeSeconds> </CORSRule> </CORSConfiguration>
Here’s how I understand it (please do correct me here if i’m wrong):
- The user drags a file onto the form field. A presigned request is made. If successful then:
- The uppy sends directly to the bucket, the file, via a put request (or is it a post request?) + and adds in various header information, which includes:
- The bucket receives the put/post and sends back some type of confirmation.
- Uppy receives the confirmation and tells the user that the file has been uploaded.
My questions, in short:
- Am trying to work out what the significance of the x-amz-date and x-amz-content-sha256 headers are, and how it works in the context of an Uppy / Direct bucket upload?
- Will I have to configure Uppy to send the equivalent Google headers, and what happens if the headers are not there?
Thank you once again for your support.