Add support for HTTP header regex replacement - #224
Merged
xosk31 merged 1 commit intoSep 1, 2026
Merged
Conversation
xosk31
approved these changes
Sep 1, 2026
Collaborator
|
Many thanks for your contribution |
kenichi-mashiyama
deleted the
add-support-for-http-header-regex-replacement
branch
September 2, 2026 00:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for replacing HTTP header values using regular expressions (
http-request replace-value) in theHTTPRequestRulesacross frontends, backends, and listens.Motivation
Currently, the HAProxy Operator supports setting and deleting HTTP headers, but it lacks the ability to modify existing header values using regular expressions (the native
http-request replace-valuedirective in HAProxy). By introducing thereplaceValuefield, users can now dynamically rewrite specific parts of HTTP header values based on regex matches directly through the CRDs.Changes
ReplaceValuestruct and field toHTTPRequestRulesinapis/config/v1alpha1/common_types.go.Model()method for HTTP Request Rules to map the new field to the native HAProxy model (Type: "replace-value", along withHdrName,HdrMatch, andHdrFormat).listen_types_test.goto verify the correct generation of thehttp-request replace-valueconfiguration.Checklist