diff --git a/api/handler/get.go b/api/handler/get.go index 6c1db9e..6ac1df6 100644 --- a/api/handler/get.go +++ b/api/handler/get.go @@ -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} } } diff --git a/api/handler/put.go b/api/handler/put.go index 311a206..77da94f 100644 --- a/api/handler/put.go +++ b/api/handler/put.go @@ -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] } }