From cb12b22048ed29c53e99b380cbc9a4ec37d5e4a3 Mon Sep 17 00:00:00 2001 From: Mikey Sleevi Date: Fri, 25 Aug 2023 10:31:05 -0600 Subject: [PATCH] Add support for Read Timeout in Rulesets API --- .changelog/1374.txt | 3 +++ rulesets.go | 1 + rulesets_test.go | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 .changelog/1374.txt diff --git a/.changelog/1374.txt b/.changelog/1374.txt new file mode 100644 index 00000000000..07bc895bb23 --- /dev/null +++ b/.changelog/1374.txt @@ -0,0 +1,3 @@ +```release_note:enhancement +rulesets: Add support for Proxy Read Timeout configuration via the Rulesets/Cache Rules API +``` \ No newline at end of file diff --git a/rulesets.go b/rulesets.go index 206a5e17c1b..92cc252dabc 100644 --- a/rulesets.go +++ b/rulesets.go @@ -247,6 +247,7 @@ type RulesetRuleActionParameters struct { Mirage *bool `json:"mirage,omitempty"` OpportunisticEncryption *bool `json:"opportunistic_encryption,omitempty"` Polish *Polish `json:"polish,omitempty"` + ReadTimeout *uint `json:"read_timeout,omitempty"` RocketLoader *bool `json:"rocket_loader,omitempty"` SecurityLevel *SecurityLevel `json:"security_level,omitempty"` ServerSideExcludes *bool `json:"server_side_excludes,omitempty"` diff --git a/rulesets_test.go b/rulesets_test.go index d2d654a1f09..18cdd964830 100644 --- a/rulesets_test.go +++ b/rulesets_test.go @@ -241,6 +241,7 @@ func TestGetRuleset_SetCacheSettings(t *testing.T) { } } }, + "read_timeout": 1000, "origin_error_page_passthru":true }, "description": "Set all available cache settings in one rule", @@ -324,6 +325,7 @@ func TestGetRuleset_SetCacheSettings(t *testing.T) { }, }, }, + ReadTimeout: UintPtr(1000), OriginErrorPagePassthru: BoolPtr(true), }, Description: "Set all available cache settings in one rule",