Skip to content

Commit

Permalink
Server filtering fixes for Mullvad and Nordvpn
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jul 23, 2020
1 parent c5c53a2 commit 0811b8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion internal/provider/mullvad.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package provider

import (
"fmt"
"strings"

"github.com/qdm12/golibs/network"
"github.com/qdm12/private-internet-access-docker/internal/constants"
Expand All @@ -26,7 +27,9 @@ func (m *mullvad) filterServers(country, city, isp string) (servers []models.Mul
if len(isp) == 0 {
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])
}
}
Expand Down
3 changes: 2 additions & 1 deletion internal/provider/nordvpn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package provider

import (
"fmt"
"strings"

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

0 comments on commit 0811b8b

Please sign in to comment.