fix(proxy): 将401/405质量检测结果调整为告警
This commit is contained in:
@@ -1908,8 +1908,13 @@ func runProxyQualityTarget(ctx context.Context, client *http.Client, target prox
|
||||
}
|
||||
|
||||
if _, ok := target.AllowedStatuses[resp.StatusCode]; ok {
|
||||
item.Status = "pass"
|
||||
item.Message = fmt.Sprintf("HTTP %d", resp.StatusCode)
|
||||
if resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices {
|
||||
item.Status = "pass"
|
||||
item.Message = fmt.Sprintf("HTTP %d", resp.StatusCode)
|
||||
} else {
|
||||
item.Status = "warn"
|
||||
item.Message = fmt.Sprintf("HTTP %d(目标可达,但鉴权或方法受限)", resp.StatusCode)
|
||||
}
|
||||
return item
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user