Skip to content

Commit bd48df2

Browse files
intgrsl0thentr0py
andauthored
fix: avoid sending empty Baggage header (getsentry#1507)
According to W3C Working Draft spec, the Baggage header must contain at least one value, an empty value is invalid. Co-authored-by: Neel Shah <neelshah.sa@gmail.com>
1 parent c57daaa commit bd48df2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sentry_sdk/tracing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,9 @@ def iter_headers(self):
308308
yield "tracestate", tracestate
309309

310310
if self.containing_transaction and self.containing_transaction._baggage:
311-
yield "baggage", self.containing_transaction._baggage.serialize()
311+
baggage = self.containing_transaction._baggage.serialize()
312+
if baggage:
313+
yield "baggage", baggage
312314

313315
@classmethod
314316
def from_traceparent(

0 commit comments

Comments
 (0)