diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-02-16 15:44:08 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-02-16 15:44:08 +0100 |
| commit | 75ac9ee246e7d3be5890b972a241855da875f4b0 (patch) | |
| tree | 59b480e4f20ec81809ec9f69cfbd7eb9f38f6ac5 /client | |
| parent | f106485d6a757e92949e0c0da6b68385879e4623 (diff) | |
HTTP: Incorporate util ensure valid url with clean path
Diffstat (limited to 'client')
| -rw-r--r-- | client/client_test.go | 3 | ||||
| -rw-r--r-- | client/server.go | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/client/client_test.go b/client/client_test.go index 4356736..5a5a39e 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -13,7 +13,6 @@ import ( httpw "github.com/eduvpn/eduvpn-common/internal/http" "github.com/eduvpn/eduvpn-common/internal/oauth" - "github.com/eduvpn/eduvpn-common/internal/util" "github.com/go-errors/errors" ) @@ -22,7 +21,7 @@ func getServerURI(t *testing.T) string { if serverURI == "" { t.Skip("Skipping server test as no SERVER_URI env var has been passed") } - serverURI, parseErr := util.EnsureValidURL(serverURI) + serverURI, parseErr := httpw.EnsureValidURL(serverURI) if parseErr != nil { t.Skip("Skipping server test as the server uri is not valid") } diff --git a/client/server.go b/client/server.go index 4070705..64f1d25 100644 --- a/client/server.go +++ b/client/server.go @@ -2,9 +2,9 @@ package client import ( "github.com/eduvpn/eduvpn-common/internal/failover" + "github.com/eduvpn/eduvpn-common/internal/http" "github.com/eduvpn/eduvpn-common/internal/oauth" "github.com/eduvpn/eduvpn-common/internal/server" - "github.com/eduvpn/eduvpn-common/internal/util" "github.com/eduvpn/eduvpn-common/types" "github.com/go-errors/errors" ) @@ -331,7 +331,7 @@ func (c *Client) AddCustomServer(url string) (srv server.Server, err error) { } }() - if url, err = util.EnsureValidURL(url); err != nil { + if url, err = http.EnsureValidURL(url); err != nil { return nil, err } @@ -457,7 +457,7 @@ func (c *Client) GetConfigCustomServer(url string, preferTCP bool, t oauth.Token } }() - if url, err = util.EnsureValidURL(url); err != nil { + if url, err = http.EnsureValidURL(url); err != nil { return nil, err } |
