forked from TrueCloudLab/frostfs-s3-gw
[#540] Add md5 S3Tests compatability
Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
This commit is contained in:
parent
d8f126b339
commit
fb00dff83b
6 changed files with 53 additions and 9 deletions
|
@ -251,7 +251,7 @@ func (h *handler) PutObjectHandler(w http.ResponseWriter, r *http.Request) {
|
|||
Reader: body,
|
||||
Header: metadata,
|
||||
Encryption: encryptionParams,
|
||||
ContentMD5: r.Header.Get(api.ContentMD5),
|
||||
ContentMD5: getMD5Header(r),
|
||||
ContentSHA256Hash: r.Header.Get(api.AmzContentSha256),
|
||||
}
|
||||
|
||||
|
@ -1038,3 +1038,13 @@ func (h *handler) parseLocationConstraint(r *http.Request) (*createBucketParams,
|
|||
}
|
||||
return params, nil
|
||||
}
|
||||
|
||||
func getMD5Header(r *http.Request) *string {
|
||||
var md5Hdr *string
|
||||
if len(r.Header.Values(api.ContentMD5)) != 0 {
|
||||
hdr := r.Header.Get(api.ContentMD5)
|
||||
md5Hdr = &hdr
|
||||
}
|
||||
|
||||
return md5Hdr
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue