Server filtering fixes for Mullvad and Nordvpn

This commit is contained in:
Quentin McGaw
2020-07-23 02:16:12 +00:00
parent c5c53a2ff8
commit 0811b8b099
2 changed files with 6 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package provider
import ( import (
"fmt" "fmt"
"strings"
"github.com/qdm12/golibs/network" "github.com/qdm12/golibs/network"
"github.com/qdm12/private-internet-access-docker/internal/constants" "github.com/qdm12/private-internet-access-docker/internal/constants"
@@ -26,7 +27,9 @@ func (m *mullvad) filterServers(country, city, isp string) (servers []models.Mul
if len(isp) == 0 { if len(isp) == 0 {
server.ISP = "" server.ISP = ""
} }
if server.Country == country && server.City == city && server.ISP == isp { if strings.EqualFold(server.Country, country) &&
strings.EqualFold(server.City, city) &&
strings.EqualFold(server.ISP, isp) {
servers = append(servers, allServers[i]) servers = append(servers, allServers[i])
} }
} }

View File

@@ -2,6 +2,7 @@ package provider
import ( import (
"fmt" "fmt"
"strings"
"github.com/qdm12/golibs/network" "github.com/qdm12/golibs/network"
"github.com/qdm12/private-internet-access-docker/internal/constants" "github.com/qdm12/private-internet-access-docker/internal/constants"
@@ -29,7 +30,7 @@ func (n *nordvpn) filterServers(region string, protocol models.NetworkProtocol,
} else if protocol == constants.UDP && !server.UDP { } else if protocol == constants.UDP && !server.UDP {
continue continue
} }
if server.Region == region && server.Number == number { if strings.EqualFold(server.Region, region) && server.Number == number {
servers = append(servers, allServers[i]) servers = append(servers, allServers[i])
} }
} }