add md5 header when UploadData to replication in ReplicatedWrite (#3881)
This commit is contained in:
@@ -30,6 +30,7 @@ type UploadOption struct {
|
||||
PairMap map[string]string
|
||||
Jwt security.EncodedJwt
|
||||
RetryForever bool
|
||||
Md5 string
|
||||
}
|
||||
|
||||
type UploadResult struct {
|
||||
@@ -254,6 +255,7 @@ func doUploadData(data []byte, option *UploadOption) (uploadResult *UploadResult
|
||||
MimeType: option.MimeType,
|
||||
PairMap: option.PairMap,
|
||||
Jwt: option.Jwt,
|
||||
Md5: option.Md5,
|
||||
})
|
||||
if uploadResult == nil {
|
||||
return
|
||||
@@ -284,6 +286,9 @@ func upload_content(fillBufferFunction func(w io.Writer) error, originalDataSize
|
||||
if option.IsInputCompressed {
|
||||
h.Set("Content-Encoding", "gzip")
|
||||
}
|
||||
if option.Md5 != "" {
|
||||
h.Set("Content-MD5", option.Md5)
|
||||
}
|
||||
|
||||
file_writer, cp_err := body_writer.CreatePart(h)
|
||||
if cp_err != nil {
|
||||
|
||||
Reference in New Issue
Block a user