diff --git a/cmd/storage-rest-server.go b/cmd/storage-rest-server.go index 99a1d03c9..309461657 100644 --- a/cmd/storage-rest-server.go +++ b/cmd/storage-rest-server.go @@ -1067,10 +1067,13 @@ func waitForHTTPStream(respBody io.ReadCloser, w io.Writer) error { return err } length := binary.LittleEndian.Uint32(tmp[:]) - _, err = io.CopyBuffer(w, io.LimitReader(respBody, int64(length)), buf) + n, err := io.CopyBuffer(w, io.LimitReader(respBody, int64(length)), buf) if err != nil { return err } + if n != int64(length) { + return io.ErrUnexpectedEOF + } continue case 32: continue