From ac6f671c544bb60a728063ed4dcd865ca5d96347 Mon Sep 17 00:00:00 2001 From: Sonia Appasamy Date: Wed, 6 Dec 2023 13:40:50 -0500 Subject: [PATCH] ipn/localapi: use clientupdate.CanAutoUpdate from serveUpdateCheck Fixes #10486 Signed-off-by: Sonia Appasamy --- ipn/localapi/localapi.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ipn/localapi/localapi.go b/ipn/localapi/localapi.go index 7d2a3c440..220d866b8 100644 --- a/ipn/localapi/localapi.go +++ b/ipn/localapi/localapi.go @@ -2378,17 +2378,9 @@ func (h *Handler) serveUpdateCheck(w http.ResponseWriter, r *http.Request) { return } - _, err := clientupdate.NewUpdater(clientupdate.Arguments{ - ForAutoUpdate: true, - }) - - if err != nil { + if !clientupdate.CanAutoUpdate() { // if we don't support auto-update, just say that we're up to date - if errors.Is(err, errors.ErrUnsupported) { - json.NewEncoder(w).Encode(tailcfg.ClientVersion{RunningLatest: true}) - } else { - http.Error(w, err.Error(), http.StatusInternalServerError) - } + json.NewEncoder(w).Encode(tailcfg.ClientVersion{RunningLatest: true}) return }