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
Member.String() accpets UTF-8 strings as baggage member values, and URL-encodes them. But it seems this URL-encoding has no effect since baggage.NewMember()does not accept UTF-8 strings.
Environment
opentelemetry-go version: 1.9.0
Steps To Reproduce
baggage.NewMember("", ";") returns an error.
Expected behavior
baggage.NewMember("", ";") does not return errors or Member.String() does no URL-encoding.
The text was updated successfully, but these errors were encountered:
The error returned from NewMember is valid based on how that function is defined:
// NewMember returns a new Member from the passed arguments. An error is
// returned if the created Member would be invalid according to the W3C
// Baggage specification.
A value contains a string whose character encoding MUST be UTF-8 [Encoding]. Any characters outside of the baggage-octet range of characters MUST be percent-encoded. Characters which are not required to be percent-encoded MAY be percent-encoded. Percent-encoding is defined in [RFC3986], Section 2.1: https://datatracker.ietf.org/doc/html/rfc3986#section-2.1.
When decoding the value, percent-encoded octet sequences that do not match the UTF-8 encoding scheme MUST be replaced with the replacement character (U+FFFD).
baggage.NewMember("key", "%3B") should be interpreted with a value of ;. Instead it is interpreted directly: https://go.dev/play/p/16d_eij-CWt
The value accepted by NewMember needs to be decoded.
Description
Member.String()
accpets UTF-8 strings as baggage member values, and URL-encodes them. But it seems this URL-encoding has no effect sincebaggage.NewMember()
does not accept UTF-8 strings.Environment
Steps To Reproduce
baggage.NewMember("", ";")
returns an error.Expected behavior
baggage.NewMember("", ";")
does not return errors orMember.String()
does no URL-encoding.The text was updated successfully, but these errors were encountered: