add regex match and substitute support to the header mutation
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 430
Description
*Title*: *One line description*
*Description*:
Now, the header mutation (both the header mutation filter and `headers_to_add`) could set/add headers by the substitution formatter. (like `%REQ(xxxxx)%`. But it's impossible to extract more fine-grained part of one header or path. It would be great to
extract sub-value from a header or path by the regex and set the sub-value to a new header.
For example:
```
header:
key: "proxy-target"
value: "%REQ(:PATH)%"
rewrite:
pattern:
regex: "/prefix/proxy/(.+)"
substitution: "\\1"
append_action: APPEND_IF_EXISTS_OR_ADD
```
[optional *Relevant Links*:]
>Any extra documentation required to understand the issue.
Contributor guide
Assessment
This issue has not been assessed yet.