diff --git a/cmd/uniget/self-upgrade.go b/cmd/uniget/self-upgrade.go index bac81d08..a9bc3442 100644 --- a/cmd/uniget/self-upgrade.go +++ b/cmd/uniget/self-upgrade.go @@ -132,10 +132,14 @@ var selfUpgradeCmd = &cobra.Command{ return fmt.Errorf("failed to remove %s: %s", selfExe, err) } - body, err := io.ReadAll(resp.Body) + bodyGz, err := io.ReadAll(resp.Body) if err != nil { return fmt.Errorf("failed to read body: %s", err) } + body, err := archive.Gunzip(bodyGz) + if err != nil { + return fmt.Errorf("failed to gunzip body: %s", err) + } err = archive.ProcessTarContents(body, func(tar *tar.Reader, header *tar.Header) error { if header.Name == "uniget" { logging.Debugf("Extracting %s", header.Name)