Skip to content

Commit

Permalink
make all uploaded object public readable
Browse files Browse the repository at this point in the history
  • Loading branch information
emil-laurell committed Dec 9, 2024
1 parent b9ad95e commit cb87872
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/app/s3manager/create_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ func HandleCreateObject(s3 S3, sseInfo SSEType, bucketMap map[string]string) htt
}
}(file)

opts := minio.PutObjectOptions{ContentType: "application/octet-stream"}
opts := minio.PutObjectOptions{
ContentType: "application/octet-stream",
UserMetadata: map[string]string{
"x-amz-acl": "public-read", // Makes the object publicly readable
},
}

if sseInfo.Type == "KMS" {
opts.ServerSideEncryption, _ = encrypt.NewSSEKMS(sseInfo.Key, nil)
Expand Down

0 comments on commit cb87872

Please sign in to comment.