Skip to content

Commit 869a59c

Browse files
authored
Merge pull request #106 from wollomatic/105-bug-isallowedclient-only-checks-the-first-valid-cidr
[Bug] isAllowedClient() only checks the first valid CIDR (fixes #105)
2 parents e5b6e50 + faff8e3 commit 869a59c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cmd/socket-proxy/handlehttprequest.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ func isAllowedClient(clientIPStr string) (bool, error) {
8686
_, allowedIPNet, err := net.ParseCIDR(allowFromItem)
8787
if err == nil {
8888
// AllowFrom is a valid CIDR, so check if IP address is in allowed network
89-
return allowedIPNet.Contains(clientIP), nil
89+
if allowedIPNet.Contains(clientIP) {
90+
return true, nil
91+
}
92+
continue
9093
}
9194

9295
// AllowFrom is not a valid CIDR, so try to resolve it via DNS

0 commit comments

Comments
 (0)