fix cmd/picoclaw/cmd_status.go:158:12: host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf (nosprintfhostport)
This commit is contained in:
parent
c758a074ad
commit
14a95c9ffb
1 changed files with 4 additions and 1 deletions
|
|
@ -5,7 +5,9 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sipeed/picoclaw/pkg/auth"
|
"github.com/sipeed/picoclaw/pkg/auth"
|
||||||
|
|
@ -155,7 +157,8 @@ func statusCmd() {
|
||||||
channelStatus(cfg.Channels.OneBot.Enabled, "OneBot")
|
channelStatus(cfg.Channels.OneBot.Enabled, "OneBot")
|
||||||
channelStatus(cfg.Channels.MaixCam.Enabled, "MaixCam")
|
channelStatus(cfg.Channels.MaixCam.Enabled, "MaixCam")
|
||||||
if cfg.Channels.WebSocket.Enabled {
|
if cfg.Channels.WebSocket.Enabled {
|
||||||
addr := fmt.Sprintf("http://%s:%d", cfg.Channels.WebSocket.Host, cfg.Channels.WebSocket.Port)
|
hostPort := net.JoinHostPort(cfg.Channels.WebSocket.Host, strconv.Itoa(cfg.Channels.WebSocket.Port))
|
||||||
|
addr := "http://" + hostPort
|
||||||
channelStatus(true, "WebSocket", addr)
|
channelStatus(true, "WebSocket", addr)
|
||||||
} else {
|
} else {
|
||||||
channelStatus(false, "WebSocket")
|
channelStatus(false, "WebSocket")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue