mirror of
https://github.com/minio/minio.git
synced 2025-04-19 18:17:30 -04:00
Fix s3MetaToAzureProperties Content-Md5 key (#5068)
This commit is contained in:
parent
866dffcd62
commit
db3fed2279
@ -101,7 +101,7 @@ func s3MetaToAzureProperties(s3Metadata map[string]string) (storage.BlobMetadata
|
|||||||
case k == "Content-Length":
|
case k == "Content-Length":
|
||||||
// assume this doesn't fail
|
// assume this doesn't fail
|
||||||
props.ContentLength, _ = strconv.ParseInt(v, 10, 64)
|
props.ContentLength, _ = strconv.ParseInt(v, 10, 64)
|
||||||
case k == "Content-MD5":
|
case k == "Content-Md5":
|
||||||
props.ContentMD5 = v
|
props.ContentMD5 = v
|
||||||
case k == "Content-Type":
|
case k == "Content-Type":
|
||||||
props.ContentType = v
|
props.ContentType = v
|
||||||
|
@ -82,6 +82,17 @@ func TestS3MetaToAzureProperties(t *testing.T) {
|
|||||||
t.Fatalf("Test failed with unexpected error %s, expected UnsupportedMetadata", err)
|
t.Fatalf("Test failed with unexpected error %s, expected UnsupportedMetadata", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
headers = map[string]string{
|
||||||
|
"content-md5": "Dce7bmCX61zvxzP5QmfelQ==",
|
||||||
|
}
|
||||||
|
_, props, err := s3MetaToAzureProperties(headers)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Test failed, with %s", err)
|
||||||
|
}
|
||||||
|
if props.ContentMD5 != headers["content-md5"] {
|
||||||
|
t.Fatalf("Test failed, expected %s, got %s", headers["content-md5"], props.ContentMD5)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAzurePropertiesToS3Meta(t *testing.T) {
|
func TestAzurePropertiesToS3Meta(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user