xds: ignore keep_empty_value and discard header keys on empty mutations#12852
Merged
kannanjgithub merged 3 commits intoJun 22, 2026
Conversation
In GrpcService/ext_proc header mutations, we do not support the `keep_empty_value` field (grpc/proposal@f6d42d6). If any header mutation results in a header containing an empty value (either string or binary), the entire header key is discarded/removed from the metadata. This chang modifies HeaderMutator to apply mutations and discard keys containing empty values.
Contributor
|
/gemini review |
Contributor
|
/gemini-review |
There was a problem hiding this comment.
Code Review
This pull request refactors the header mutation logic in HeaderMutator.java to discard headers containing empty values, updating the corresponding test cases in HeaderMutatorTest.java to reflect this change. A review comment suggests that the newly added containsEmpty helper method is redundant and can be safely removed.
sauravzg
reviewed
Jun 10, 2026
sauravzg
approved these changes
Jun 10, 2026
Updates the HeaderMutator library to always apply mutations even if the resulting value is empty, ignoring the keep_empty_value setting altogether. Empty mutated values are now kept in the metadata and the header key is no longer discarded. - Removes containsEmpty check and helper from HeaderMutator. - Updates HeaderMutatorTest to assert that empty mutations are kept.
Contributor
Author
|
I'm retaining the empty value now (same as Envoy), not removing it. |
sauravzg
approved these changes
Jun 22, 2026
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.
In GrpcService/ext_proc header mutations, we do not support the
keep_empty_valuefield (grpc/proposal@f6d42d6). If any header mutation results in a header containing an empty value (either string or binary), we proceed with the empty value.