fix issue with invalid third-party proxy ending up in the valid third-party list

This commit is contained in:
Cyberes 2024-04-22 20:55:37 -06:00
parent 68a444c17c
commit ea89052ef0
1 changed files with 6 additions and 3 deletions

View File

@ -78,15 +78,18 @@ func (p *ForwardProxyCluster) ValidateProxiesThread() {
// Sort the proxy into the right groups.
if isThirdparty(pxy) {
newThirdpartyOnlineProxies = append(newThirdpartyOnlineProxies, pxy)
okToAdd := true
for _, d := range config.GetConfig().ThirdpartyTestUrls {
_, bv3hiErr := sendRequestThroughProxy(pxy, d)
if bv3hiErr != nil {
log.Debugf("Validate - Third-party %s failed: %s", proxyHost, bv3hiErr)
okToAdd = false
newThirdpartyBrokenProxies = append(newThirdpartyBrokenProxies, pxy)
log.Debugf("Validate - Third-party %s failed: %s", proxyHost, bv3hiErr)
}
}
if okToAdd {
newThirdpartyOnlineProxies = append(newThirdpartyOnlineProxies, pxy)
}
} else {
newOurOnlineProxies = append(newOurOnlineProxies, pxy)
}