diff --git a/root/update.go b/root/update.go index ae286e6..3ae242b 100644 --- a/root/update.go +++ b/root/update.go @@ -90,6 +90,10 @@ func FetchLatestVersion() (string, error) { } defer func() { _ = resp.Body.Close() }() + if resp.StatusCode != http.StatusOK { + return "", fmt.Errorf("unexpected status code: %d", resp.StatusCode) + } + body, err := io.ReadAll(resp.Body) if err != nil { return "", err