fix: loosen agent version checking

- warn instead of error when version mismatch
- check for major version only
- better version parsing
This commit is contained in:
yusing
2025-04-26 05:38:59 +08:00
parent e4be403bef
commit 01179adfa8
6 changed files with 130 additions and 40 deletions

View File

@@ -53,7 +53,7 @@ func (mon *HTTPHealthMonitor) CheckHealth() (result *health.HealthCheckResult, e
}
req.Close = true
req.Header.Set("Connection", "close")
req.Header.Set("User-Agent", "GoDoxy/"+pkg.GetVersion())
req.Header.Set("User-Agent", "GoDoxy/"+pkg.GetVersion().String())
start := time.Now()
resp, respErr := pinger.Do(req)