Skip to content

Commit

Permalink
opt IsPrivateNetwork func (#962)
Browse files Browse the repository at this point in the history
for k8s .cluster.local
  • Loading branch information
buffge authored Jan 7, 2024
1 parent 1576b7b commit f475144
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion util/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ func IsPrivateNetwork(remoteAddr string) bool {
if remoteAddr == "localhost" {
return true
}

// private domain eg. .cluster.local
if strings.HasSuffix(remoteAddr, ".local") {
return true
}
return false
}

Expand Down

0 comments on commit f475144

Please sign in to comment.