diff --git a/cmd/krew/cmd/internal/fetch_tag.go b/cmd/krew/cmd/internal/fetch_tag.go index 8ec5ce77..51697920 100644 --- a/cmd/krew/cmd/internal/fetch_tag.go +++ b/cmd/krew/cmd/internal/fetch_tag.go @@ -36,6 +36,9 @@ func FetchLatestTag() (string, error) { if err != nil { return "", errors.Wrapf(err, "could not GET the latest release") } + if response.StatusCode != http.StatusOK { + return "", errors.Errorf("expected HTTP status 200 OK, got %s", response.Status) + } defer response.Body.Close() var res struct {