Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Increment the:

## [Unreleased]

* [API] Parse baggage value as spec compliant
[#3758](https://github.com/open-telemetry/opentelemetry-cpp/pull/3758)

## [1.24 2025-11-20]

* [RELEASE] Bump main branch to 1.24-dev
Expand Down
4 changes: 2 additions & 2 deletions api/include/opentelemetry/baggage/baggage.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ class OPENTELEMETRY_EXPORT Baggage
{
ret.push_back(' ');
}
else if (std::isalnum(str[i]) || str[i] == '-' || str[i] == '_' || str[i] == '.' ||
str[i] == '~')
else if (str[i] >= ' ' && str[i] <= '~' && str[i] != '"' && str[i] != ',' && str[i] != ';' &&
str[i] != '\\')
{
ret.push_back(str[i]);
}
Expand Down
2 changes: 2 additions & 0 deletions api/test/baggage/baggage_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ TEST(BaggageTest, ValidateExtractHeader)
{"1a-2f%40foo=bar%251,a%2A%2Ffoo-_%2Fbar=bar+4",
{"1a-2f@foo", "a*/foo-_/bar"},
{"bar%1", "bar 4"}}, // decoding is done properly
{"field=foo:bar", {"field"}, {"foo:bar"}}, // colon in value
{"mixed=a/b:c?d=e", {"mixed"}, {"a/b:c?d=e"}}, // mixed special characters
{"k1=v1,invalidmember,k2=v2", {"k1", "k2"}, {"v1", "v2"}}, // invalid member is skipped
{",", {}, {}},
{",=,", {}, {}},
Expand Down
Loading