Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion sentry_sdk/tracing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def from_incoming_header(

with capture_internal_exceptions():
item = item.strip()
key, val = item.split("=")
key, val = item.split("=", 1)
if Baggage.SENTRY_PREFIX_REGEX.match(key):
baggage_key = unquote(key.split("-")[1])
sentry_items[baggage_key] = unquote(val)
Expand Down
7 changes: 7 additions & 0 deletions tests/test_tracing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,10 @@ def test_should_continue_trace(

baggage = Baggage.from_incoming_header(baggage_header) if baggage_header else None
assert _should_continue_trace(baggage) == should_continue_trace


def test_baggage_from_incoming_header_value_with_equals_sign():
# Baggage values that legitimately contain '=' (e.g. base64) must not be dropped
header = "sentry-release=v1.0==1,sentry-trace_id=abc123"
baggage = Baggage.from_incoming_header(header)
assert baggage.sentry_items == {"release": "v1.0==1", "trace_id": "abc123"}