mirror of https://github.com/gofiber/fiber.git
🩹 Fix: corrects ipv6 loopback ip shown on UI (#1517)
Author: Rupesh Harode <rupeshharode@gmail.com> Co-authored-by: Rupesh Harode <rupesh.harode@dailyrounds.org>pull/1523/head
parent
12c1bf91bc
commit
9dd39c0e55
7
app.go
7
app.go
|
@ -954,9 +954,14 @@ func (app *App) startupMessage(addr string, tls bool, pids string) {
|
|||
|
||||
host, port := parseAddr(addr)
|
||||
if host == "" {
|
||||
host = "0.0.0.0"
|
||||
if app.config.Network == NetworkTCP6 {
|
||||
host = "[::1]"
|
||||
} else {
|
||||
host = "0.0.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
scheme := "http"
|
||||
if tls {
|
||||
scheme = "https"
|
||||
|
|
|
@ -194,7 +194,7 @@ func Test_Utils_Parse_Address(t *testing.T) {
|
|||
testCases := []struct {
|
||||
addr, host, port string
|
||||
}{
|
||||
{"[::]:3000", "[::]", "3000"},
|
||||
{"[::1]:3000", "[::1]", "3000"},
|
||||
{"127.0.0.1:3000", "127.0.0.1", "3000"},
|
||||
{"/path/to/unix/socket", "/path/to/unix/socket", ""},
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ func Test_App_Prefork_Child_Process(t *testing.T) {
|
|||
utils.AssertEqual(t, nil, app.Shutdown())
|
||||
}()
|
||||
|
||||
utils.AssertEqual(t, nil, app.prefork(NetworkTCP6, "[::]:", nil))
|
||||
utils.AssertEqual(t, nil, app.prefork(NetworkTCP6, "[::1]:", nil))
|
||||
|
||||
// Create tls certificate
|
||||
cer, err := tls.LoadX509KeyPair("./.github/testdata/ssl.pem", "./.github/testdata/ssl.key")
|
||||
|
|
Loading…
Reference in New Issue