mirror of
https://github.com/XIU2/CloudflareSpeedTest.git
synced 2026-08-29 22:07:58 +08:00
fix: 修复HTTP状态码校验逻辑(&&改为||)
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user