fix: crash in storage rest client due to spurious query params (#9924)

regression got introduced in dee3cf2d7f
when the DeleteVersion API was changed, but the corresponding query
params were left in-tact.
This commit is contained in:
Harshavardhana
2020-06-26 16:49:49 -07:00
committed by GitHub
parent cf5d051afc
commit f7f12b8604
3 changed files with 11 additions and 7 deletions

View File

@@ -289,8 +289,9 @@ func (client *storageRESTClient) DeleteVersion(volume, path string, fi FileInfo)
values.Set(storageRESTFilePath, path)
var buffer bytes.Buffer
encoder := gob.NewEncoder(&buffer)
encoder.Encode(&fi)
if err := gob.NewEncoder(&buffer).Encode(fi); err != nil {
return err
}
respBody, err := client.call(storageRESTMethodDeleteVersion, values, &buffer, -1)
defer http.DrainBody(respBody)