Trim server url in client init
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
log "github.com/Sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
|
|
||||||
@@ -37,7 +38,7 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func MakeClient(serverUrl string) *Client {
|
func MakeClient(serverUrl string) *Client {
|
||||||
return &Client{Url: serverUrl}
|
return &Client{Url: strings.TrimSuffix(serverUrl, "/")}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) delete(relativeUrl string) error {
|
func (c *Client) delete(relativeUrl string) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user