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
parent cf87303094
commit 3242847ec0

View File

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