summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/server.go2
-rw-r--r--internal/discovery/discovery.go8
2 files changed, 5 insertions, 5 deletions
diff --git a/client/server.go b/client/server.go
index 32b7687..bf4ad6a 100644
--- a/client/server.go
+++ b/client/server.go
@@ -105,7 +105,7 @@ func (c *Client) SetSecureLocation(countryCode string) error {
return err
}
- srv, err := c.Discovery.ServerByCountryCode(countryCode, "secure_internet")
+ srv, err := c.Discovery.ServerByCountryCode(countryCode)
if err != nil {
c.goBackInternal()
c.logError(err)
diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go
index 7109bc9..b2a90cd 100644
--- a/internal/discovery/discovery.go
+++ b/internal/discovery/discovery.go
@@ -101,15 +101,15 @@ func (discovery *Discovery) ServerByURL(
return nil, errors.Errorf("no server of type '%s' at URL '%s'", srvType, baseURL)
}
-// ServerByCountryCode returns the discovery server by the country code and the according type ("secure_internet", "institute_access")
+// ServerByCountryCode returns the discovery server by the country code
// An error is returned if and only if nil is returned for the server.
-func (discovery *Discovery) ServerByCountryCode(countryCode string, srvType string) (*types.DiscoveryServer, error) {
+func (discovery *Discovery) ServerByCountryCode(countryCode string) (*types.DiscoveryServer, error) {
for _, srv := range discovery.servers.List {
- if srv.CountryCode == countryCode && srv.Type == srvType {
+ if srv.CountryCode == countryCode && srv.Type == "secure_internet" {
return &srv, nil
}
}
- return nil, errors.Errorf("no server of type '%s' with country code '%s'", srvType, countryCode)
+ return nil, errors.Errorf("no server of type 'secure_internet' with country code '%s'", countryCode)
}
// orgByID returns the discovery organization by the organization ID