修改对Windows客户端版本更新通知信息

Signed-off-by: Chenyang Gao <gps949@outlook.com>
This commit is contained in:
Chenyang Gao
2023-05-14 10:09:21 +08:00
parent 7b0b5dcd4c
commit 7e7e4a9157

View File

@@ -139,10 +139,14 @@ func (h *Mirage) generateMapResponse(
resp.ClientVersion = &tailcfg.ClientVersion{}
switch true {
case strings.Contains(mapRequest.Hostinfo.OS, "windows"):
resp.ClientVersion.LatestVersion = h.cfg.ClientVersion.Win.Version
resp.ClientVersion.NotifyURL = h.cfg.ClientVersion.Win.Url
if mapRequest.Hostinfo.OS == "windows" {
if IsUpdateAvailable(mapRequest.Hostinfo.IPNVersion, h.cfg.ClientVersion.Win.Version) {
resp.ClientVersion.RunningLatest = false
resp.ClientVersion.LatestVersion = strings.Split(h.cfg.ClientVersion.Win.Version, "-")[0]
resp.ClientVersion.NotifyURL = h.cfg.ClientVersion.Win.Url
} else {
resp.ClientVersion.RunningLatest = true
}
}
log.Trace().