fix: 修复HTTP状态码校验逻辑(&&改为||)

This commit is contained in:
masgzy
2026-08-23 00:51:15 +08:00
parent 1da0c025d7
commit 54dcd1f884
+1 -1
View File
@@ -61,7 +61,7 @@ func (p *Ping) httping(ip *net.IPAddr) (int, time.Duration, string) {
//fmt.Println("IP:", ip, "StatusCode:", response.StatusCode, response.Request.URL)
// 如果未指定的 HTTP 状态码,或指定的状态码不合规,则默认只认为 200、301、302 才算 HTTPing 通过
if HttpingStatusCode == 0 || HttpingStatusCode < 100 && HttpingStatusCode > 599 {
if HttpingStatusCode == 0 || HttpingStatusCode < 100 || HttpingStatusCode > 599 {
if response.StatusCode != 200 && response.StatusCode != 301 && response.StatusCode != 302 {
if utils.Debug { // 调试模式下,输出更多信息
utils.Red.Printf("[调试] IP: %s, 延迟测速终止,HTTP 状态码: %d, 测速地址: %s\n", ip.String(), response.StatusCode, URL)