Skip to content

Conversation

@yoursanonymous
Copy link

Which problem is this PR solving?

This PR fixes an issue where parseKeyPairsIntoRecord() dropped baggage key-value pairs with empty values.

According to the W3C Baggage specification, empty values are valid, but the current implementation filtered them out during parsing. This caused valid baggage entries to be lost.

Fixes #6138

Short description of the changes

Updated parsePairKeyValue to allow empty baggage values while rejecting invalid pairs.

Ensured parseKeyPairsIntoRecord() preserves entries with empty values.

Added unit tests to cover empty baggage value handling and prevent regressions.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added unit tests for parseKeyPairsIntoRecord covering empty baggage values.

Tests were executed locally using:
npx mocha test/common/baggage/utils.test.ts

All existing and new tests pass.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@yoursanonymous yoursanonymous requested a review from a team as a code owner December 17, 2025 19:32
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 17, 2025

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: yoursanonymous / name: Vinayak Sharma (0e91adc)

it('filters out empty values', () => {
assert.deepStrictEqual(parseKeyPairsIntoRecord('key1=,key2=value2'), {
key2: 'value2',
it('prevents empty baggage values', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more accurate test title might be something like: supports empty string values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parseKeyPairsIntoRecord() filters out pairs with an empty value, and perhaps should not

2 participants