Skip to content

Commit

Permalink
feature (plg_backend_s3): calculate the right mime type
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-kerjean committed Jan 25, 2024
1 parent 3a1253d commit 4660f3a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/plugin/plg_backend_s3/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ func (this S3Backend) Touch(path string) error {
ContentLength: aws.Int64(0),
Bucket: aws.String(p.bucket),
Key: aws.String(p.path),
ContentType: aws.String(GetMimeType(path)),
}
if this.params["encryption_key"] != "" {
input.SSECustomerAlgorithm = aws.String("AES256")
Expand All @@ -484,9 +485,10 @@ func (this S3Backend) Save(path string, file io.Reader) error {
}
uploader := s3manager.NewUploader(this.createSession(p.bucket))
input := s3manager.UploadInput{
Body: file,
Bucket: aws.String(p.bucket),
Key: aws.String(p.path),
Body: file,
Bucket: aws.String(p.bucket),
Key: aws.String(p.path),
ContentType: aws.String(GetMimeType(path)),
}
if this.params["encryption_key"] != "" {
input.SSECustomerAlgorithm = aws.String("AES256")
Expand Down

0 comments on commit 4660f3a

Please sign in to comment.