Skip to content

Commit b8d84b7

Browse files
committed
minor
1 parent 29637da commit b8d84b7

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

core/netutil/addr.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ func ResolveVHost(addr string) string {
186186
if idx := strings.IndexByte(addr, ':'); idx == 0 {
187187
// only port, then return the 0.0.0.0
188188
return /* "0.0.0.0" */ "localhost" + addr[idx:]
189+
} else if idx > 0 { // if 0.0.0.0:80 let's just convert it to localhost.
190+
if addr[0:idx] == "0.0.0.0" {
191+
if addr[idx:] == ":80" {
192+
return "localhost"
193+
}
194+
return "localhost" + addr[idx:]
195+
}
189196
}
190197

191198
// with ':' in order to not replace the ipv6 loopback addresses

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ require (
8181
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
8282
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
8383
github.com/modern-go/reflect2 v1.0.2 // indirect
84-
github.com/nats-io/jwt/v2 v2.4.1 // indirect
84+
github.com/nats-io/jwt/v2 v2.5.0 // indirect
8585
github.com/nats-io/nats.go v1.28.0 // indirect
8686
github.com/nats-io/nkeys v0.4.4 // indirect
8787
github.com/nats-io/nuid v1.0.1 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)