mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-11 22:30:47 +01:00
refactor(docker): simplify flow of isLocal check
This commit is contained in:
@@ -174,11 +174,14 @@ func isLocal(c *types.Container) bool {
|
||||
return false
|
||||
}
|
||||
hostname := url.Hostname()
|
||||
if hostname == "localhost" {
|
||||
return true
|
||||
}
|
||||
ip := net.ParseIP(hostname)
|
||||
if ip != nil {
|
||||
return ip.IsLoopback() || ip.IsUnspecified()
|
||||
}
|
||||
return hostname == "localhost"
|
||||
return false
|
||||
}
|
||||
|
||||
func setPublicHostname(c *types.Container) {
|
||||
|
||||
Reference in New Issue
Block a user