Skip to content

Commit

Permalink
tidy up code
Browse files Browse the repository at this point in the history
  • Loading branch information
ida613 committed Feb 5, 2025
1 parent 70435b2 commit 23fa992
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/dd-trace/src/opentracing/propagation/text_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class TextMapPropagator {
context = extractedContext
if (this._config.tracePropagationExtractFirst) {
if (this._hasPropagationStyle('extract', 'baggage') && carrier.baggage) {
if (context) this._extractBaggageItems(carrier, context)
this._extractBaggageItems(carrier, context)
}
return context
}
Expand All @@ -348,7 +348,7 @@ class TextMapPropagator {
}

if (this._hasPropagationStyle('extract', 'baggage') && carrier.baggage) {
if (context) this._extractBaggageItems(carrier, context)
this._extractBaggageItems(carrier, context)
}

return context || this._extractSqsdContext(carrier)
Expand Down Expand Up @@ -598,6 +598,7 @@ class TextMapPropagator {
}

_extractBaggageItems (carrier, spanContext) {
if (!carrier) return
const baggages = carrier.baggage.split(',')
for (const keyValue of baggages) {
if (!keyValue.includes('=')) {
Expand Down

0 comments on commit 23fa992

Please sign in to comment.