diff --git a/rate_limiting.go b/rate_limiting.go index 253c44b1fe..e3eb3e2e7b 100644 --- a/rate_limiting.go +++ b/rate_limiting.go @@ -18,7 +18,7 @@ type RateLimit struct { Threshold int `json:"threshold"` Period int `json:"period"` Action RateLimitAction `json:"action"` - Correlate RateLimitCorrelate `json:"correlate"` + Correlate *RateLimitCorrelate `json:"correlate,omitempty"` } // RateLimitTrafficMatcher contains the rules that will be used to apply a rate limit to traffic diff --git a/rate_limiting_example_test.go b/rate_limiting_example_test.go index a1f47a9ab6..52b1db5555 100644 --- a/rate_limiting_example_test.go +++ b/rate_limiting_example_test.go @@ -20,7 +20,7 @@ var exampleNewRateLimit = cloudflare.RateLimit{ Mode: "ban", Timeout: 60, }, - Correlate: cloudflare.RateLimitCorrelate{ + Correlate: &cloudflare.RateLimitCorrelate{ By: "nat", }, } diff --git a/rate_limiting_test.go b/rate_limiting_test.go index fac36052fc..50c9d099dc 100644 --- a/rate_limiting_test.go +++ b/rate_limiting_test.go @@ -65,7 +65,7 @@ var expectedRateLimitStruct = RateLimit{ Mode: "ban", Timeout: 60, }, - Correlate: RateLimitCorrelate{ + Correlate: &RateLimitCorrelate{ By: "nat", }, } @@ -89,7 +89,7 @@ var expectedRateLimitStructUpdated = RateLimit{ Mode: "ban", Timeout: 60, }, - Correlate: RateLimitCorrelate{ + Correlate: &RateLimitCorrelate{ By: "nat", }, } @@ -260,7 +260,7 @@ func TestCreateRateLimit(t *testing.T) { Mode: "ban", Timeout: 60, }, - Correlate: RateLimitCorrelate{ + Correlate: &RateLimitCorrelate{ By: "nat", }, }