node: fix listening on IPv6 address (#27628) (#27635)

This commit is contained in:
Curith
2023-07-02 13:21:16 +02:00
committed by GitHub
parent 8bbb16b70e
commit 6ca3ef9a7b
5 changed files with 10 additions and 6 deletions
+2 -1
View File
@@ -19,6 +19,7 @@ package debug
import (
"fmt"
"io"
"net"
"net/http"
_ "net/http/pprof"
"os"
@@ -308,7 +309,7 @@ func Setup(ctx *cli.Context) error {
port := ctx.Int(pprofPortFlag.Name)
address := fmt.Sprintf("%s:%d", listenHost, port)
address := net.JoinHostPort(listenHost, fmt.Sprintf("%d", port))
// This context value ("metrics.addr") represents the utils.MetricsHTTPFlag.Name.
// It cannot be imported because it will cause a cyclical dependency.
StartPProf(address, !ctx.IsSet("metrics.addr"))