oss_16_baggage_metadata_and_percent_encoding#24
Conversation
Baggage entry metadata (the ;-delimited properties a W3C Baggage entry may carry) was previously used only for validation on extract and never stored, so it was silently dropped and could not be re-injected. set_baggage now accepts an optional metadata parameter; extract splits the value from its metadata and stores the metadata alongside the entry, and inject re-appends it verbatim. A new get_baggage_metadata accessor exposes it. Spaces were encoded with quote_plus/unquote_plus, emitting a space as + which spec-compliant receivers misread. Injection and extraction now use quote/unquote so a space is encoded as %20 per the W3C Baggage format. Existing set_baggage(name, value) calls are unaffected.
|
🔒 Internal (dash0) — not for upstream.
|
|
📣 Public-facing draft — to be used for the upstream PR in Title: Preserve W3C Baggage metadata and fix space percent-encoding WhatFixes two W3C Baggage conformance issues in
WhyMetadata was validated then discarded and there was no API to set it, so properties were silently lost (cf. Go SpecW3C Baggage format: https://www.w3.org/TR/baggage/ · OpenTelemetry Baggage API: TestsNew: metadata round-trips extract→inject; metadata via Backward compatibility
|
Closes #20
Preserve W3C Baggage entry metadata and percent-encode spaces as %20 (Linear OSS-16, findings P2/P3). set_baggage gains optional metadata + get_baggage_metadata; propagator splits/re-appends metadata and uses quote/unquote. Validation: api suite 45 passed (baggage+w3c propagator), scope api+changelog. Note: 3 pre-existing tests that asserted the old buggy behavior were updated.
Linear issue: https://linear.app/dash0/issue/OSS-16/p2-p3-w3c-baggage-metadata-dropped-wrong-percent-encoding-vs-percent20