SentryBaggage.fromHeaderList constructor

SentryBaggage.fromHeaderList(
  1. List<String> headerValues, {
  2. SentryLogger? logger,
})

Implementation

factory SentryBaggage.fromHeaderList(
  List<String> headerValues, {
  SentryLogger? logger,
}) {
  final keyValues = <String, String>{};

  for (final headerValue in headerValues) {
    final keyValuesToAdd = _extractKeyValuesFromBaggageString(
      headerValue,
      logger: logger,
    );
    keyValues.addAll(keyValuesToAdd);
  }

  return SentryBaggage(keyValues, logger: logger);
}