@@ -163,16 +163,15 @@ export function mergeAndSerializeBaggage(incomingBaggage?: Baggage, thirdPartyBa
163
163
}
164
164
165
165
/**
166
- * Helper function that takes a raw baggage string (if available) and the processed sentry-trace header
167
- * data (if available), parses the baggage string and creates a Baggage object
168
- * If there is no baggage string, it will create an empty Baggage object.
169
- * In a second step, this functions determines if the created Baggage object should be set immutable
170
- * to prevent mutation of the Sentry data.
166
+ * Helper function that takes a raw baggage value (if available) and the processed sentry-trace header
167
+ * data (if available), parses the baggage value and creates a Baggage object. If there is no baggage
168
+ * value, it will create an empty Baggage object.
171
169
*
172
- * Extracted this logic to a function because it's duplicated in a lot of places.
170
+ * In a second step, this functions determines if the created Baggage object should be set immutable
171
+ * to prevent mutation of the Sentry data. It does this by looking at the processed sentry-trace header.
173
172
*
174
- * @param rawBaggageValue
175
- * @param sentryTraceHeader
173
+ * @param rawBaggageValue baggage value from header
174
+ * @param sentryTraceHeader processed Sentry trace header returned from `extractTraceparentData`
176
175
*/
177
176
export function parseBaggageSetMutability (
178
177
rawBaggageValue : HttpHeaderValue | false | undefined ,
@@ -187,7 +186,7 @@ export function parseBaggageSetMutability(
187
186
// this SDK is the head of the trace and thus we still permit mutation at this time.
188
187
// There is one exception though, which is that we get a baggage-header with `sentry-`
189
188
// items but NO sentry-trace header. In this case we also set the baggage immutable for now
190
- // but if smoething like this would ever happen, we should revisit this and determine
189
+ // but if something like this would ever happen, we should revisit this and determine
191
190
// what this would actually mean for the trace (i.e. is this SDK the head?, what happened
192
191
// before that we don't have a sentry-trace header?, etc)
193
192
( sentryTraceHeader || ! isSentryBaggageEmpty ( baggage ) ) && setBaggageImmutable ( baggage ) ;
0 commit comments