1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

fix snapshot url parsing issue for ip addresses (#7478)

This commit is contained in:
Matt Hook 2022-08-16 10:36:12 +12:00 committed by GitHub
parent 36c93c7f57
commit 81d1f35bdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,6 +7,7 @@ import (
"net/http"
netUrl "net/url"
"strconv"
"strings"
"time"
portainer "github.com/portainer/portainer/api"
@ -26,6 +27,10 @@ func GetAgentVersionAndPlatform(url string, tlsConfig *tls.Config) (portainer.Ag
}
}
if !strings.Contains(url, "://") {
url = "https://" + url
}
parsedURL, err := netUrl.Parse(fmt.Sprintf("%s/ping", url))
if err != nil {
return 0, "", err