Skip to content

Clarify the allowance of an empty string in the baggage names #4082

@XSAM

Description

@XSAM

What are you trying to achieve?

Clarify the allowance of an empty string in the baggage names.

Additional context.

After #3801, we allow the UTF-8 string in the baggage. However, an empty string is also a valid UTF-8 string.

UTF8-octets = *( UTF8-char )

https://datatracker.ietf.org/doc/html/rfc3629

This means we allow our baggage names to be empty. = and =bar become valid baggages, which are strange baggage.


FYI, the W3C baggage specification does not allow an empty baggage name.

key = token ; as defined in RFC 7230, Section 3.2.6

https://www.w3.org/TR/baggage/#definition


I am not against the design of allowing empty strings in baggage names, as it does not bring compatible issues while parsing W3C baggage. But it might be worth mentioning in the doc that we actually allow empty strings in baggage names, so it won't confuse people while implementing.

Related PR: open-telemetry/opentelemetry-go#5132

Metadata

Metadata

Assignees

No one assigned

    Labels

    spec:baggageRelated to the specification/baggage directorytriage:deciding:tc-inboxNeeds attention from the TC in order to move forward

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions