fix: set content-encoding: gzip for non-legacy KV restore (#195)

This commit is contained in:
Daniel Moran 2021-07-13 15:59:37 -04:00 committed by GitHub
parent 88b5c748b8
commit a69f06b41b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,7 +166,7 @@ func (c Client) fullRestore(ctx context.Context, path string, legacy bool) error
// Upload metadata snapshots to the server.
log.Println("INFO: Restoring KV snapshot")
kvReq := c.PostRestoreKV(ctx).ContentType("application/octet-stream").Body(kvBytes)
if legacy {
if !legacy {
kvReq = kvReq.ContentEncoding("gzip")
}
if err := kvReq.Execute(); err != nil {