Skip to content

Commit

Permalink
bug: fix unintentional provisioning of {Allow,Deny}CIDR
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammed90 committed Mar 28, 2023
1 parent e3e4cbf commit 8d3ac56
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ func (t *HTTP) provisionOpts() error {
t.opts = append(t.opts, config.WithMetadata(t.Metadata))
}

if t.AllowCIDR != nil {
if len(t.AllowCIDR) > 0 {
t.opts = append(t.opts, config.WithAllowCIDRString(t.AllowCIDR...))
}

if t.DenyCIDR != nil {
if len(t.DenyCIDR) > 0 {
t.opts = append(t.opts, config.WithDenyCIDRString(t.DenyCIDR...))
}

Expand Down
4 changes: 2 additions & 2 deletions tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ func (t *TCP) provisionOpts() error {
t.opts = append(t.opts, config.WithMetadata(t.Metadata))
}

if t.AllowCIDR != nil {
if len(t.AllowCIDR) > 0 {
t.opts = append(t.opts, config.WithAllowCIDRString(t.AllowCIDR...))
}

if t.DenyCIDR != nil {
if len(t.DenyCIDR) > 0 {
t.opts = append(t.opts, config.WithDenyCIDRString(t.DenyCIDR...))
}

Expand Down
4 changes: 2 additions & 2 deletions tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ func (t *TLS) provisionOpts() error {
t.opts = append(t.opts, config.WithMetadata(t.Metadata))
}

if t.AllowCIDR != nil {
if len(t.AllowCIDR) > 0 {
t.opts = append(t.opts, config.WithAllowCIDRString(t.AllowCIDR...))
}

if t.DenyCIDR != nil {
if len(t.DenyCIDR) > 0 {
t.opts = append(t.opts, config.WithDenyCIDRString(t.DenyCIDR...))
}

Expand Down

0 comments on commit 8d3ac56

Please sign in to comment.