[#198] Fix object metadata

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2021-08-06 14:46:19 +03:00 committed by Stanislav Bogatyrev
parent e5b1dae750
commit a89add8ff3
2 changed files with 2 additions and 2 deletions

View file

@ -73,7 +73,7 @@ func writeHeaders(h http.Header, info *layer.ObjectInfo) {
h.Set(api.ETag, info.HashSum)
for key, val := range info.Headers {
h.Set(api.MetadataPrefix+key, val)
h[api.MetadataPrefix+key] = []string{val}
}
}

View file

@ -59,7 +59,7 @@ func parseMetadata(r *http.Request) map[string]string {
res := make(map[string]string)
for k, v := range r.Header {
if strings.HasPrefix(k, api.MetadataPrefix) {
key := strings.TrimPrefix(k, api.MetadataPrefix)
key := strings.ToLower(strings.TrimPrefix(k, api.MetadataPrefix))
res[key] = v[0]
}
}