aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Stiborský <martin.stiborsky@gmail.com>2024-05-14 15:48:24 +0200
committerGitHub <noreply@github.com>2024-05-14 06:48:24 -0700
commit54f3913bedf3145a899f2ef872735dd54e468fcc (patch)
tree83727ba51293de77ddad3bf57d45ddbae1691b60
parent31653e4b1e78652b7696990993f38abda72af525 (diff)
downloadseaweedfs-54f3913bedf3145a899f2ef872735dd54e468fcc.tar.xz
seaweedfs-54f3913bedf3145a899f2ef872735dd54e468fcc.zip
[s3] Fixed s3 replication by sending content-md as base64 (#5596)
-rw-r--r--weed/replication/sink/s3sink/s3_sink.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/replication/sink/s3sink/s3_sink.go b/weed/replication/sink/s3sink/s3_sink.go
index 81acd9a2d..6e7549cdc 100644
--- a/weed/replication/sink/s3sink/s3_sink.go
+++ b/weed/replication/sink/s3sink/s3_sink.go
@@ -11,6 +11,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"strconv"
"strings"
+ "encoding/base64"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
@@ -202,7 +203,7 @@ func (s3sink *S3Sink) CreateEntry(key string, entry *filer_pb.Entry, signatures
Tagging: aws.String(tags),
}
if len(entry.Attributes.Md5) > 0 {
- uploadInput.ContentMD5 = aws.String(fmt.Sprintf("%x", entry.Attributes.Md5))
+ uploadInput.ContentMD5 = aws.String(base64.StdEncoding.EncodeToString([]byte(entry.Attributes.Md5)))
}
_, err = uploader.Upload(&uploadInput)