Repository navigation
Conversation
Pull request dashboard statusWaiting on maintainers · refreshed 2026-10-27 00:36 UTC Merge when ready. Status above doesn't look right?
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Oversized incoming headers allocate every split member before limits take effect, causing a verified memory-amplification regression.
1 open issue
What changed in this PR
Updates the API’s W3C baggage propagation to address multiple-header handling (#5811) and percent encoding (#5566), alongside validation and size-limit changes.
Changes:
- Processes all baggage headers with shared limits and retains entries that fit.
- Preserves literal
+and encoded whitespace, validates token keys, and separates properties from values. - Replaces delimiter regex splitting and expands regression coverage.
| File | Description |
|---|---|
opentelemetry-api/tests/util/test_re.py |
Tests whitespace and empty header members. |
opentelemetry-api/tests/propagators/test_w3cbaggagepropagator.py |
Covers revised extraction, injection, encoding, and limits. |
opentelemetry-api/tests/baggage/test_baggage.py |
Tests character-set validation and property syntax. |
opentelemetry-api/src/opentelemetry/util/re.py |
Replaces regex-based environment-header splitting. |
opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py |
Updates multi-header parsing, encoding, and key handling. |
opentelemetry-api/src/opentelemetry/baggage/__init__.py |
Uses character sets for baggage validation. |
.changelog/5823.fixed |
Records the baggage compliance fixes. |
Review effort: Balanced
Refactor _split_baggage_entries to use find method for splitting headers. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This was referenced Oct 24, 2026
xrmx
approved these changes
Oct 26, 2026
aabmass
reviewed
Oct 26, 2026
This branch has not been deployed
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.

Description
Brings
W3CBaggagePropagatorin line with the W3C Baggage spec.Also fixes #5811 and #5566
Closes #5814 #5791
+is no longerturned into a space.
%20at either end is kept.;properties are validated but no longer stored as part of the value. Before, they werere-sent as encoded value data.
on inject.
[ \t]*,[ \t]*split regex took quadratic time on long whitespace runs. It is replacedwith
str.split(","), which also fixesparse_env_headers. Key and value validation now uses character setsinstead of regexes.
Type of change
Please delete options that are not relevant.
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
tox -e precommittox -e typecheck