Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
d27a72f8
Unverified
Commit
d27a72f8
authored
Feb 15, 2021
by
Arve Knudsen
Committed by
GitHub
Feb 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPv6: Support host address configured with enclosing square brackets (#31226)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent
d56c5285
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
pkg/api/http_server.go
+4
-1
pkg/services/ldap/ldap.go
+2
-0
No files found.
pkg/api/http_server.go
View file @
d27a72f8
...
@@ -10,6 +10,7 @@ import (
...
@@ -10,6 +10,7 @@ import (
"os"
"os"
"path"
"path"
"path/filepath"
"path/filepath"
"strings"
"sync"
"sync"
"github.com/grafana/grafana/pkg/services/live"
"github.com/grafana/grafana/pkg/services/live"
...
@@ -103,8 +104,10 @@ func (hs *HTTPServer) Run(ctx context.Context) error {
...
@@ -103,8 +104,10 @@ func (hs *HTTPServer) Run(ctx context.Context) error {
hs
.
applyRoutes
()
hs
.
applyRoutes
()
// Remove any square brackets enclosing IPv6 addresses, a format we support for backwards compatibility
host
:=
strings
.
TrimSuffix
(
strings
.
TrimPrefix
(
setting
.
HttpAddr
,
"["
),
"]"
)
hs
.
httpSrv
=
&
http
.
Server
{
hs
.
httpSrv
=
&
http
.
Server
{
Addr
:
net
.
JoinHostPort
(
setting
.
HttpAddr
,
setting
.
HttpPort
),
Addr
:
net
.
JoinHostPort
(
host
,
setting
.
HttpPort
),
Handler
:
hs
.
macaron
,
Handler
:
hs
.
macaron
,
}
}
switch
hs
.
Cfg
.
Protocol
{
switch
hs
.
Cfg
.
Protocol
{
...
...
pkg/services/ldap/ldap.go
View file @
d27a72f8
...
@@ -114,6 +114,8 @@ func (server *Server) Dial() error {
...
@@ -114,6 +114,8 @@ func (server *Server) Dial() error {
}
}
}
}
for
_
,
host
:=
range
strings
.
Split
(
server
.
Config
.
Host
,
" "
)
{
for
_
,
host
:=
range
strings
.
Split
(
server
.
Config
.
Host
,
" "
)
{
// Remove any square brackets enclosing IPv6 addresses, a format we support for backwards compatibility
host
=
strings
.
TrimSuffix
(
strings
.
TrimPrefix
(
host
,
"["
),
"]"
)
address
:=
net
.
JoinHostPort
(
host
,
strconv
.
Itoa
(
server
.
Config
.
Port
))
address
:=
net
.
JoinHostPort
(
host
,
strconv
.
Itoa
(
server
.
Config
.
Port
))
if
server
.
Config
.
UseSSL
{
if
server
.
Config
.
UseSSL
{
tlsCfg
:=
&
tls
.
Config
{
tlsCfg
:=
&
tls
.
Config
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment