You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
breaking change - response_rules are now evaluated in the order they defined in the config and they distinguish between invalid/setup based on the rule's type attribute, rather than setting invalid/setup block within response_rules configuration block
Copy file name to clipboardExpand all lines: pkg/target/http.go
+56-50Lines changed: 56 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ import (
19
19
"io"
20
20
"net/http"
21
21
"os"
22
+
"slices"
22
23
"strconv"
23
24
"strings"
24
25
"text/template"
@@ -71,14 +72,23 @@ type HTTPTargetConfig struct {
71
72
72
73
// ResponseRules is part of HTTP target configuration. It provides rules how HTTP respones should be handled. Response can be categerized as 'invalid' (bad data), as setup error or (if none of the rules matches) as a transient error.
73
74
typeResponseRulesstruct {
74
-
Invalid []Rule`hcl:"invalid,block"`
75
-
SetupError []Rule`hcl:"setup,block"`
75
+
Rules []Rule`hcl:"rule,block"`
76
+
// Invalid []Rule `hcl:"invalid,block"`
77
+
// SetupError []Rule `hcl:"setup,block"`
76
78
}
77
79
80
+
typeResponseRuleTypestring
81
+
82
+
const (
83
+
ResponseRuleTypeInvalidResponseRuleType="invalid"
84
+
ResponseRuleTypeSetupResponseRuleType="setup"
85
+
)
86
+
78
87
// Rule configuration defines what kind of values are expected to exist in HTTP response, like status code or message in the body.
0 commit comments