Skip to content

Commit fcb62ff

Browse files
author
gm0stache
committed
fix: format IPv6 addr correclty for HTTP URL
1 parent d3ee739 commit fcb62ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/client/dns.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"io"
8+
"net"
89
"net/http"
910
"sync"
1011
"time"
@@ -108,7 +109,8 @@ func verifyCaddyReachable(ctx context.Context, m *pb.MachineInfo) error {
108109
eventID := fmt.Sprintf("Machine %s (%s)", m.Name, publicIP)
109110
pw.Event(progress.NewEvent(eventID, progress.Working, "Querying"))
110111

111-
verifyURL := fmt.Sprintf("http://%s%s", publicIP, caddyconfig.VerifyPath)
112+
httpFormattedIP := net.JoinHostPort(publicIP.String(), "")
113+
verifyURL := fmt.Sprintf("http://%s%s", httpFormattedIP, caddyconfig.VerifyPath)
112114

113115
req, err := http.NewRequestWithContext(ctx, http.MethodGet, verifyURL, nil)
114116
if err != nil {

0 commit comments

Comments
 (0)