Fix W3CBaggagePropagator to allow empty baggage values per W3C spec#8468
Open
dahyvuun wants to merge 2 commits into
Open
Fix W3CBaggagePropagator to allow empty baggage values per W3C spec#8468dahyvuun wants to merge 2 commits into
dahyvuun wants to merge 2 commits into
Conversation
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8468 +/- ##
============================================
+ Coverage 91.00% 91.03% +0.03%
- Complexity 7817 7823 +6
============================================
Files 893 893
Lines 23721 23727 +6
Branches 2364 2365 +1
============================================
+ Hits 21588 21601 +13
+ Misses 1410 1407 -3
+ Partials 723 719 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jaydeluca
reviewed
Jun 10, 2026
|
|
||
| private final BitSet excluded; | ||
| private boolean allowEmpty; | ||
| private boolean seenWhitespace; |
Member
There was a problem hiding this comment.
Member
There was a problem hiding this comment.
this is still not addressed. You can remove this entire seenWhitespace variable and related code branches, and then the extract_value_onlySpaces test needs to be updated to:
@Test
void extract_value_onlySpaces() {
W3CBaggagePropagator propagator = W3CBaggagePropagator.getInstance();
Context result =
propagator.extract(Context.root(), ImmutableMap.of("baggage", "key1= "), getter);
Baggage expectedBaggage =
Baggage.builder().put("key1", "").build();
assertThat(Baggage.fromContext(result)).isEqualTo(expectedBaggage);
}
zeitlinger
approved these changes
Jun 11, 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.
Fixes #8465
W3CBaggagePropagatordrops baggage entries with empty values likekey1=, but the W3C spec definesvalue = *baggage-octet, meaning zero characters is valid..NET, Go, and Rust implementations already accept empty values — Java was the only outlier.
Changes
allowEmptyflag toElement.createValueElement()to permit empty string valuesseenWhitespacetracking to distinguishkey=(valid) fromkey=(invalid)