mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Enhance Portainer URL parsing in Client
This commit is contained in:
parent
00439cc1c1
commit
0d42ed73c6
@ -10,6 +10,7 @@ import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
@ -282,7 +283,7 @@ func (n *PortainerClient) Clone() (c *PortainerClient, err error) {
|
||||
|
||||
// Create a new client
|
||||
func NewClient(config ClientConfig) (c *PortainerClient, err error) {
|
||||
apiUrl, err := url.Parse(config.Url + "/api/")
|
||||
apiUrl, err := url.Parse(strings.TrimRight(config.Url, "/") + "/api/")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user