Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add previewBaseUrl, which allows overriding hardcoded 'https://${bucket}.s3.amazonaws.com' why:
This allows specifying URL for buckets served via CDN and static website hosting, example of such hosting https://support.cloudflare.com/hc/en-us/articles/360037983412-Configuring-an-Amazon-Web-Services-static-site-to-use-Cloudflare
For example, if my S3 bucket is named
static.example.com
then I will not be able to get it's public files (with public-read ACL) usinghttps://${bucket}.s3.amazonaws.com/myfile.png
->https://static.example.com.s3.amazonaws.com/myfile.png
, because buckets with dot's not covered by AWS SSL certificate. To fix this you might also want to usehttps://s3.${region}.amazonaws.com/${bucket}/myfile.png
- here we use a standard domain, which has a good certificate, I would recommend using this endpoint because this is more universal (I did not perform this in pull request because probably you also other reasons, and my current option is backward compatible for all existing installations)But ideally, me and other users who are serving S3 buckets via CDN, need the ability to load images from https://static.example.com/myfile.png (it preaches images on CDN and makes URLs more similar to those which we use in prod
I added Content-Type Metadata to s3 which is useful in multiple cases. For example, when you upload SVGs, S3 sets System Content-Type application/octet-stream which brakes disposition and is subject to CORB