Calling source.store on AWS S3 resolves likely before the ACL policy is set, resulting in a 403 error when accessing the image straight away
Steps to replicate
const source = tinify.fromFile("large.jpg");
await source.store({
service: "s3",
aws_access_key_id: "AKIAIOSFODNN7EXAMPLE",
aws_secret_access_key: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
region: "us-west-1",
headers: {
Cache-Control: "public, max-age=31536000"
},
path: "example-bucket/my-images/optimized.jpg"
});
Open path_to_example_bucket/my-images/optimized.jpg
Expected:
source.store to resolve when the optimized file is public.