hotfix(surfshark): REGION retro-compatibility
This commit is contained in:
@@ -21,7 +21,8 @@ type Provider struct {
|
|||||||
PortForwarding PortForwarding
|
PortForwarding PortForwarding
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p Provider) validate(vpnType string, allServers models.AllServers) (err error) {
|
// TODO v4 remove pointer for receiver (because of Surfshark).
|
||||||
|
func (p *Provider) validate(vpnType string, allServers models.AllServers) (err error) {
|
||||||
// Validate Name
|
// Validate Name
|
||||||
var validNames []string
|
var validNames []string
|
||||||
if vpnType == constants.OpenVPN {
|
if vpnType == constants.OpenVPN {
|
||||||
|
|||||||
@@ -22,7 +22,10 @@ type Settings struct {
|
|||||||
VPN VPN
|
VPN VPN
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s Settings) Validate(allServers models.AllServers) (err error) {
|
// Validate validates all the settings and returns an error
|
||||||
|
// if one of them is not valid.
|
||||||
|
// TODO v4 remove pointer for receiver (because of Surfshark).
|
||||||
|
func (s *Settings) Validate(allServers models.AllServers) (err error) {
|
||||||
nameToValidation := map[string]func() error{
|
nameToValidation := map[string]func() error{
|
||||||
"control server": s.ControlServer.validate,
|
"control server": s.ControlServer.validate,
|
||||||
"dns": s.DNS.validate,
|
"dns": s.DNS.validate,
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ type VPN struct {
|
|||||||
Wireguard Wireguard
|
Wireguard Wireguard
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates VPN settings.
|
// TODO v4 remove pointer for receiver (because of Surfshark).
|
||||||
func (v VPN) validate(allServers models.AllServers) (err error) {
|
func (v *VPN) validate(allServers models.AllServers) (err error) {
|
||||||
// Validate Type
|
// Validate Type
|
||||||
validVPNTypes := []string{constants.OpenVPN, constants.Wireguard}
|
validVPNTypes := []string{constants.OpenVPN, constants.Wireguard}
|
||||||
if !helpers.IsOneOf(v.Type, validVPNTypes...) {
|
if !helpers.IsOneOf(v.Type, validVPNTypes...) {
|
||||||
|
|||||||
Reference in New Issue
Block a user