Skip to content

source.store resolves before public access is set to the S3 file #36

@and2

Description

@and2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions