mirror of
https://github.com/minio/minio.git
synced 2025-03-31 01:33:41 -04:00
do not save any metadata from the headers in tar extract (#17436)
only preserve the same storage-class as incoming request other than that rest of them must be deduced.
This commit is contained in:
parent
e98309eb75
commit
47a48b6832
@ -2111,36 +2111,16 @@ 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
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove the snowball headers from metadata from objects
|
|
||||||
// since those are actionable headers and not for storage
|
|
||||||
delete(metadata, xhttp.AmzSnowballExtract)
|
|
||||||
delete(metadata, xhttp.AmzSnowballExtract)
|
|
||||||
delete(metadata, xhttp.MinIOSnowballIgnoreDirs)
|
|
||||||
delete(metadata, xhttp.MinIOSnowballIgnoreErrors)
|
|
||||||
delete(metadata, xhttp.MinIOSnowballPrefix)
|
|
||||||
|
|
||||||
// Use the same storage class as the original uploaded tar file
|
|
||||||
if sc != "" {
|
|
||||||
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()
|
||||||
|
|
||||||
// Copy metadata and make space for a bit more
|
if sc == "" {
|
||||||
metaCopy := make(map[string]string, len(metadata)+5)
|
sc = storageclass.STANDARD
|
||||||
for k, v := range metadata {
|
}
|
||||||
metaCopy[k] = v
|
|
||||||
|
metadata := map[string]string{
|
||||||
|
xhttp.AmzStorageClass: sc, // save same storage-class as incoming stream.
|
||||||
}
|
}
|
||||||
// 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