Kaynağa Gözat

ipn/localapi: use clientupdate.CanAutoUpdate from serveUpdateCheck

Fixes #10486

Signed-off-by: Sonia Appasamy <[email protected]>
Sonia Appasamy 2 yıl önce
ebeveyn
işleme
ac6f671c54
1 değiştirilmiş dosya ile 2 ekleme ve 10 silme
  1. 2 10
      ipn/localapi/localapi.go

+ 2 - 10
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
 	}