k1LoW / serverless-s3-sync

A plugin to sync local directories and S3 prefixes for Serverless Framework :zap:
183 stars 70 forks source link

CacheControl header and other additional header turned into User-defined x-amz-meta-* metadata? #46

Open joyfulelement opened 4 years ago

joyfulelement commented 4 years ago

Hi, the use case is to set the System metadata for objects uploaded on S3 buckets. However, the result turned into User-defined metadata with prefix x-amz-meta- which is not expected.

e.g.

- bucketName: ${self:custom.bucketName}
      defaultContentType: "text/javascript"
      params: # optional
        - "*.js":
            CacheControl: "public, max-age=31536000"
            ContentType: "text/javascript"

Turned into:

Screen Shot 2020-02-06 at 11 47 13 AM

While the existing system metadata Content-type value remains intact. i.e. not synced Also, the defaultContentType does not work either, instead of setting it to text/javascript, it always fall back to application/octet-stream

Question

Is there a support to set or override System metadata for objects uploaded on S3 buckets? Many thanks!

nibynool commented 4 years ago

This should be setting the System metadata correctly. What version of the plugin are you using?