Fix: HideMyAss: Cote d'Ivoire server country

This commit is contained in:
Quentin McGaw (desktop)
2021-09-21 23:56:53 +00:00
parent 6bcbaf085d
commit c22e0e9db7
2 changed files with 154 additions and 128 deletions

View File

@@ -27,8 +27,13 @@ func parseOpenvpnURL(url, protocol string) (country, region, city string) {
city = parts[2]
}
return camelCaseToWords(country), camelCaseToWords(region),
camelCaseToWords(city)
country = camelCaseToWords(country)
region = camelCaseToWords(region)
city = camelCaseToWords(city)
country = mutateSpecialCountryCases(country)
return country, region, city
}
func camelCaseToWords(camelCase string) (words string) {
@@ -42,3 +47,12 @@ func camelCaseToWords(camelCase string) (words string) {
}
return words
}
func mutateSpecialCountryCases(country string) string {
switch country {
case "Coted`Ivoire":
return "Cote d'Ivoire"
default:
return country
}
}