Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add regex match and substitute support to the header mutation #37885

Open
wbpcode opened this issue Jan 6, 2025 · 1 comment
Open

add regex match and substitute support to the header mutation #37885

wbpcode opened this issue Jan 6, 2025 · 1 comment
Labels
enhancement Feature requests. Not bugs or questions.

Comments

@wbpcode
Copy link
Member

wbpcode commented Jan 6, 2025

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.

@wbpcode wbpcode added enhancement Feature requests. Not bugs or questions. triage Issue requires triage and removed triage Issue requires triage labels Jan 6, 2025
@wbpcode
Copy link
Member Author

wbpcode commented Jan 22, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests. Not bugs or questions.
Projects
None yet
Development

No branches or pull requests

1 participant