From 3442f7a518485b74e8eb29fd39c7c8cc5ec54c2c Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 29 May 2023 04:10:08 +0200 Subject: [PATCH] fix: work around cloudflare r2 not conforming to s3 api standards --- backend/db/flags.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/db/flags.go b/backend/db/flags.go index e722d16..576f76a 100644 --- a/backend/db/flags.go +++ b/backend/db/flags.go @@ -248,8 +248,9 @@ func (db *DB) WriteFlag(ctx context.Context, flagID xid.ID, flag *bytes.Buffer) } hash = hex.EncodeToString(hasher.Sum(nil)) - _, err = db.minio.PutObject(ctx, db.minioBucket, "/flags/"+hash+".webp", flag, -1, minio.PutObjectOptions{ - ContentType: "image/webp", + _, err = db.minio.PutObject(ctx, db.minioBucket, "flags/"+hash+".webp", flag, -1, minio.PutObjectOptions{ + ContentType: "image/webp", + SendContentMd5: true, }) if err != nil { return "", errors.Wrap(err, "uploading flag")