mirror of
https://github.com/minio/minio.git
synced 2025-01-23 12:43:16 -05:00
Snowball: Extract headers for metadata (#17042)
This commit is contained in:
parent
6825bd7e75
commit
f66625be67
@ -2078,11 +2078,24 @@ func (api objectAPIHandlers) PutObjectExtractHandler(w http.ResponseWriter, r *h
|
|||||||
getObjectInfo = api.CacheAPI().GetObjectInfo
|
getObjectInfo = api.CacheAPI().GetObjectInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extract request metadata
|
||||||
|
metadata, err := extractMetadata(ctx, r)
|
||||||
|
if err != nil {
|
||||||
|
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
metadata[xhttp.AmzStorageClass] = sc
|
||||||
|
|
||||||
putObjectTar := func(reader io.Reader, info os.FileInfo, object string) error {
|
putObjectTar := func(reader io.Reader, info os.FileInfo, object string) error {
|
||||||
size := info.Size()
|
size := info.Size()
|
||||||
metadata := map[string]string{
|
|
||||||
xhttp.AmzStorageClass: sc,
|
// Copy metadata and make space for a bit more
|
||||||
|
metaCopy := make(map[string]string, len(metadata)+5)
|
||||||
|
for k, v := range metadata {
|
||||||
|
metaCopy[k] = v
|
||||||
}
|
}
|
||||||
|
// Shadow now...
|
||||||
|
metadata := metaCopy
|
||||||
|
|
||||||
actualSize := size
|
actualSize := size
|
||||||
var idxCb func() []byte
|
var idxCb func() []byte
|
||||||
|
Loading…
x
Reference in New Issue
Block a user