mirror of
https://github.com/tailscale/tailscale.git
synced 2024-12-01 22:15:51 +00:00
ipn/localapi: use clientupdate.CanAutoUpdate from serveUpdateCheck
Fixes #10486 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
This commit is contained in:
parent
a54a4f757b
commit
ac6f671c54
@ -2378,17 +2378,9 @@ func (h *Handler) serveUpdateCheck(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := clientupdate.NewUpdater(clientupdate.Arguments{
|
if !clientupdate.CanAutoUpdate() {
|
||||||
ForAutoUpdate: true,
|
|
||||||
})
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
// if we don't support auto-update, just say that we're up to date
|
// 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})
|
json.NewEncoder(w).Encode(tailcfg.ClientVersion{RunningLatest: true})
|
||||||
} else {
|
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user