k1LoW / serverless-s3-sync

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

Handle file/glob level params in the same way @Auth0/s3 does when setting metadata #44

Closed nibynool closed 4 years ago

nibynool commented 4 years ago

When updating metadata, use the ContentType defined for the file/glob pattern, otherwise fallback to the defaultContentType value, otherwise do not include a content type.

This will fix some use cases that will experience the issue in #43, but will still drop the Content-Type value when it has been auto-detected by @auth0/s3

nibynool commented 4 years ago

After creating my initial commit I discovered the same issue exists with the CacheControl options.

The most recent commit uses the same method of mime-type detection as @auth0/s3 and also handles the file/glob level parameters in the same way as @auth0/s3. This should mean that the metadata update will not lose any settings when it copies the file to trigger the update.

k1LoW commented 4 years ago

@nibynool THANK YOU !!!!

k1LoW commented 4 years ago

Released as v1.10.2.