From bded7c64d485ce5aaf82982573a041314257b4dc Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Thu, 8 Mar 2018 21:53:13 +0100 Subject: fix URL computation in Account.Capabilties() --- account.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/account.go b/account.go index 1e50707..95a2b45 100644 --- a/account.go +++ b/account.go @@ -23,7 +23,6 @@ import ( "fmt" "net/http" "regexp" - "strings" ) //Account represents a Swift account. @@ -203,13 +202,7 @@ func (a *Account) Capabilities() (Capabilities, error) { func (a *Account) RawCapabilities() ([]byte, error) { //This method is the only one in Schwift that bypasses struct Request since //the request URL is not below the endpoint URL. - - uri := a.backend.EndpointURL() - uri = strings.TrimPrefix(uri, "/") - uri = strings.TrimPrefix(uri, "/v1") - uri += "/info" - - req, err := http.NewRequest("GET", uri, nil) + req, err := http.NewRequest("GET", a.baseURL+"info", nil) if err != nil { return nil, err } -- cgit v1.2.3