You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Baggage propagator appears to be encoding Baggage Member values on Inject but never decoding them on Extract. For multiple passive hops, the Baggage Member value will continue getting encoded.
Environment
OS: linux/mac
Architecture: x86_64
Go Version: 1.17
opentelemetry-go version: v1.2.0
Steps To Reproduce
Set a baggage header with a member value that requires encoding
Pass the baggage through multiple Inject/Extracts of the Baggage propagator.
Here's a test to demonstrate the behavior in isolation:
func TestBaggage(t *testing.T) {
propagator := propagation.Baggage{}
hc := propagation.HeaderCarrier{}
hc.Set("baggage", "myKey=1%3D1")
want := "1%3D1"
ctx := context.Background()
ctx = propagator.Extract(ctx, hc)
actual := baggage.FromContext(ctx).Member("myKey").Value()
require.Equal(t, want, actual)
// inject will encode the '%' literal from the already encoded value
propagator.Inject(ctx, hc)
ctx = propagator.Extract(ctx, hc)
actual = baggage.FromContext(ctx).Member("myKey").Value()
require.Equal(t, want, actual) // fail
}
Expected behavior
The Baggage Member value should be decoded when being extracted onto the Context.
The text was updated successfully, but these errors were encountered:
Description
According to the spec, Baggage header values should be encoded in transit.
The Baggage propagator appears to be encoding Baggage Member values on Inject but never decoding them on Extract. For multiple passive hops, the Baggage Member value will continue getting encoded.
Environment
Steps To Reproduce
Here's a test to demonstrate the behavior in isolation:
Expected behavior
The Baggage Member value should be decoded when being extracted onto the Context.
The text was updated successfully, but these errors were encountered: