mirror of
https://github.com/caddyserver/caddy.git
synced 2026-01-17 01:30:34 +00:00
admin: Disable host checking if wildcard interface is specified
To clarify, listening on wildcard interfaces is NOT the default and should only be done under certain circumstances and when you know what you're doing. Emits a warning in the log. Fixes https://github.com/caddyserver/caddy-docker/issues/71
This commit is contained in:
10
listeners.go
10
listeners.go
@@ -302,6 +302,16 @@ func (na NetworkAddress) isLoopback() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (na NetworkAddress) isWildcardInterface() bool {
|
||||
if na.Host == "" {
|
||||
return true
|
||||
}
|
||||
if ip := net.ParseIP(na.Host); ip != nil {
|
||||
return ip.IsUnspecified()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (na NetworkAddress) port() string {
|
||||
if na.StartPort == na.EndPort {
|
||||
return strconv.FormatUint(uint64(na.StartPort), 10)
|
||||
|
||||
Reference in New Issue
Block a user