aboutsummaryrefslogtreecommitdiff
path: root/account.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2018-03-08 21:53:13 +0100
committerStefan Majewsky <majewsky@gmx.net>2018-03-08 21:53:13 +0100
commitbded7c64d485ce5aaf82982573a041314257b4dc (patch)
tree33f5a42f85d0bbd9c176824c744f6b93cdf416fd /account.go
parent640d395b63f3ee88a71b529dc2a2182c7a0fe5fe (diff)
downloadgo-schwift-bded7c64d485ce5aaf82982573a041314257b4dc.tar.gz
fix URL computation in Account.Capabilties()
Diffstat (limited to 'account.go')
-rw-r--r--account.go9
1 files changed, 1 insertions, 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
}