From cb8787257c44b7d203fc6bd02e2b6c7a72a11302 Mon Sep 17 00:00:00 2001 From: Emil Laurell Date: Mon, 9 Dec 2024 15:16:44 +0100 Subject: [PATCH] make all uploaded object public readable --- internal/app/s3manager/create_object.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/app/s3manager/create_object.go b/internal/app/s3manager/create_object.go index 7967eb7..836233c 100644 --- a/internal/app/s3manager/create_object.go +++ b/internal/app/s3manager/create_object.go @@ -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)