Skip to content

Commit

Permalink
update s3 header for read access
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayflipkart committed Apr 26, 2020
1 parent 9b858ef commit c3954d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ func NewS3Client(opts S3ClientOpts) (S3Client, error) {
func (s *s3client) PutFile(bucket, key, path string) error {
log.Infof("Saving from %s to s3 (endpoint: %s, bucket: %s, key: %s)", path, s.Endpoint, bucket, key)
// NOTE: minio will detect proper mime-type based on file extension
_, err := s.minioClient.FPutObject(bucket, key, path, minio.PutObjectOptions{})
metadata := make(map[string]string)
metadata["x-amz-acl"] = "public-read"
putObjectOptions := minio.PutObjectOptions{
UserMetadata: metadata,
}
_, err := s.minioClient.FPutObject(bucket, key, path, putObjectOptions)
if err != nil {
return errors.WithStack(err)
}
Expand Down

0 comments on commit c3954d0

Please sign in to comment.