mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 00:08:10 -05:00
Chore: Use net.JoinHostPort (#28421)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@@ -107,7 +107,7 @@ func (hs *HTTPServer) Run(ctx context.Context) error {
|
||||
hs.applyRoutes()
|
||||
|
||||
hs.httpSrv = &http.Server{
|
||||
Addr: fmt.Sprintf("%s:%s", setting.HttpAddr, setting.HttpPort),
|
||||
Addr: net.JoinHostPort(setting.HttpAddr, setting.HttpPort),
|
||||
Handler: hs.macaron,
|
||||
}
|
||||
switch setting.Protocol {
|
||||
|
||||
@@ -7,6 +7,8 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
@@ -110,7 +112,7 @@ func (server *Server) Dial() error {
|
||||
}
|
||||
}
|
||||
for _, host := range strings.Split(server.Config.Host, " ") {
|
||||
address := fmt.Sprintf("%s:%d", host, server.Config.Port)
|
||||
address := net.JoinHostPort(host, strconv.Itoa(server.Config.Port))
|
||||
if server.Config.UseSSL {
|
||||
tlsCfg := &tls.Config{
|
||||
InsecureSkipVerify: server.Config.SkipVerifySSL,
|
||||
|
||||
Reference in New Issue
Block a user