XL: GetObjectInfo() store and retrieve user-defined object metadata. (#2189)

This commit is contained in:
utsl42
2016-07-12 15:45:17 -04:00
committed by Harshavardhana
parent 5cd629adca
commit e5cd35aad0
4 changed files with 12 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ import (
"net/http"
"runtime"
"strconv"
"strings"
)
//// helpers
@@ -72,6 +73,11 @@ func setObjectHeaders(w http.ResponseWriter, objInfo ObjectInfo, contentRange *h
}
w.Header().Set("Content-Length", strconv.FormatInt(objInfo.Size, 10))
for k, v := range objInfo.UserDefined {
if strings.HasPrefix(k, "X-Amz-Meta-") {
w.Header().Set(k, v)
}
}
// for providing ranged content
if contentRange != nil && contentRange.offsetBegin > -1 {