avoid network read errors crashing CreateFile call (#11939)

Thanks to @dvaldivia for reproducing this
This commit is contained in:
Harshavardhana
2021-03-31 18:44:45 -07:00
committed by GitHub
parent f60eaabfcd
commit 3c571472e0

View File

@@ -340,9 +340,8 @@ func (client *storageRESTClient) CreateFile(ctx context.Context, volume, path st
if err != nil {
return err
}
waitReader, err := waitForHTTPResponse(respBody)
defer http.DrainBody(ioutil.NopCloser(waitReader))
defer respBody.Close()
_, err = waitForHTTPResponse(respBody)
defer http.DrainBody(respBody)
return err
}