fix(config): validate least_time default_time is not negative

This commit is contained in:
xfy 2026-06-08 18:03:52 +08:00
parent cb1f86298e
commit 3b6b70a491

View File

@ -509,6 +509,9 @@ func validateProxy(p *ProxyConfig) error {
if p.LeastTime.Metric != "" && p.LeastTime.Metric != "header" && p.LeastTime.Metric != "last_byte" {
return fmt.Errorf("无效的 least_time metric: %s有效值: header, last_byte", p.LeastTime.Metric)
}
if p.LeastTime.DefaultTime < 0 {
return fmt.Errorf("least_time default_time 不能为负数")
}
}
// validate sticky config