Skip to content

Commit 14d9dd0

Browse files
committed
HTTP scenario var/header postprocessor use multiple pipes
803e9ad581cd4a1790bd6c50c41f58c27724f6ac
1 parent c89292c commit 14d9dd0

13 files changed

Lines changed: 327 additions & 251 deletions

File tree

.changes/v0.5.29.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## v0.5.29 - 2024-06-25
2+
### Added
3+
* HTTP scenario var/header postprocessor use multiple pipes

.mapping.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
".changes/v0.5.26.md":"load/projects/pandora/.changes/v0.5.26.md",
2727
".changes/v0.5.27.md":"load/projects/pandora/.changes/v0.5.27.md",
2828
".changes/v0.5.28.md":"load/projects/pandora/.changes/v0.5.28.md",
29+
".changes/v0.5.29.md":"load/projects/pandora/.changes/v0.5.29.md",
2930
".changie.yaml":"load/projects/pandora/.changie.yaml",
3031
".github/actions/setup-yc/action.yml":"load/projects/pandora/.github/actions/setup-yc/action.yml",
3132
".github/workflows/release.yml":"load/projects/pandora/.github/workflows/release.yml",

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
66
and is generated by [Changie](https://github.com/miniscruff/changie).
77

88

9+
## v0.5.29 - 2024-06-25
10+
### Added
11+
* HTTP scenario var/header postprocessor use multiple pipes
12+
913
## v0.5.28 - 2024-06-24
1014
### Changed
1115
* `discard_overflow` logic. Waiter wait 2 seconds sliding window before skip payload

cli/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"go.uber.org/zap/zapcore"
2626
)
2727

28-
const Version = "0.5.28"
28+
const Version = "0.5.29"
2929
const defaultConfigFile = "load"
3030
const stdinConfigSelector = "-"
3131

components/providers/scenario/http/postprocessor/var_header.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,22 @@ func (p *VarHeaderPostprocessor) parseValue(v string) (value string, modifier fu
4646
if len(vals) == 1 {
4747
return vals[0], func(in string) string { return in }, nil
4848
}
49-
if len(vals) > 2 {
50-
return "", nil, fmt.Errorf("VarHeaderPostprocessor supports only one modifier yet")
51-
}
52-
modifier, err = p.parseModifier(vals[1])
53-
if err != nil {
54-
return "", nil, fmt.Errorf("failed to parse modifier %s: %w", vals[1], err)
49+
50+
value = vals[0]
51+
modifier = func(in string) string { return in }
52+
53+
for _, modStr := range vals[1:] {
54+
mod, err := p.parseModifier(modStr)
55+
if err != nil {
56+
return "", nil, fmt.Errorf("failed to parse modifier %s: %w", modStr, err)
57+
}
58+
previousModifier := modifier
59+
modifier = func(in string) string {
60+
return mod(previousModifier(in))
61+
}
5562
}
5663

57-
return vals[0], modifier, nil
64+
return value, modifier, nil
5865
}
5966

6067
func (p *VarHeaderPostprocessor) parseModifier(s string) (func(in string) string, error) {

0 commit comments

Comments
 (0)