fix: work around cloudflare r2 not conforming to s3 api standards

This commit is contained in:
Sam 2023-05-29 04:10:08 +02:00
parent 05cba6937f
commit 3442f7a518
No known key found for this signature in database
GPG Key ID: B4EF20DDE721CAA1
1 changed files with 3 additions and 2 deletions

View File

@ -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")