Skip to content

Commit

Permalink
use strings.Fields instead of strings.Split
Browse files Browse the repository at this point in the history
strings.Fields splits based on *consecutive* whitespace chars not only a single whitespace char
  • Loading branch information
therealak12 committed Oct 24, 2023
1 parent 83389df commit 7437c33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/utils/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func GetIPWhitelist(route *routev1.Route) []contourv1.IPFilterPolicy {
if !ok {
return filterPolicies
}
whitelistCIDRs := strings.Split(whitelist, " ")
whitelistCIDRs := strings.Fields(whitelist)
for _, cidr := range whitelistCIDRs {
filterPolicies = append(filterPolicies, contourv1.IPFilterPolicy{
Source: contourv1.IPFilterSourcePeer,
Expand Down

0 comments on commit 7437c33

Please sign in to comment.