Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NH-82238 Don't inject baggage header if empty #386

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

tammy-baylis-swi
Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi commented Jul 2, 2024

In SW propagator inject method for outgoing requests, do not re-inject baggage header if value is empty, i.e. if "baggage": ""

I think technically "baggage": "" is allowed according to HTTP RFC 7230 section 3.2 where

field-value = *( field-content / obs-fold )

and

HTTP does not place a predefined limit on the length of each header field or on the length of the header section as a whole

The W3C Candidate Recommendation for Baggage does not explicitly mention a separate header length requirement.

For the W3C Recommendation for tracestate, it says this, which is not for Baggage but seems like a good guide for not continuing baggage propagation if empty:

Empty and whitespace-only list members are allowed. Vendors MUST accept empty tracestate headers but SHOULD avoid sending them. Empty list members are allowed in tracestate because it is difficult for a vendor to recognize the empty value when multiple tracestate headers are sent. Whitespace characters are allowed for a similar reason, as some vendors automatically inject whitespace after a comma separator, even in the case of an empty header.

@tammy-baylis-swi tammy-baylis-swi marked this pull request as ready for review July 2, 2024 21:51
@tammy-baylis-swi tammy-baylis-swi requested a review from a team as a code owner July 2, 2024 21:51
Copy link
Contributor

@cheempz cheempz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tammy-baylis-swi tammy-baylis-swi merged commit 8fb4c14 into main Jul 2, 2024
11 checks passed
@tammy-baylis-swi tammy-baylis-swi deleted the NH-82238-dont-inject-empty-baggage branch July 2, 2024 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants