CopyObject: fix read/write err on closed pipe (#15135)

Fixes: #15128
Regression from PR#14971
This commit is contained in:
Poorna
2022-06-21 19:20:11 -07:00
committed by GitHub
parent 1cfb03fb74
commit cb097e6b0a
2 changed files with 3 additions and 4 deletions

View File

@@ -1433,10 +1433,6 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re
srcInfo.metadataOnly = false
}
if srcInfo.metadataOnly {
gr.Close() // We are not interested in the reader stream at this point close it.
}
// Check if x-amz-metadata-directive or x-amz-tagging-directive was not set to REPLACE and source,
// destination are same objects. Apply this restriction also when
// metadataOnly is true indicating that we are not overwriting the object.