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

internal/transport: fix a bug causing -bin metadata to be incorrectly encoded #3985

Merged
merged 1 commit into from Oct 29, 2020

Conversation

@dntj
Copy link
Contributor

@dntj dntj commented Oct 25, 2020

Most interfaces for adding metadata to a context downcase keys, except metadata.AppendToOutgoingContext (presumably for performance reasons). Documentation for metadata.AppendToOutgoingContext, referring to that of metadata.Pairs, states that metadata keys are downcased.

The bug is manifest if you use metadata.AppendToOutgoingContext to add metadata with a non-downcased -Bin suffix. http2Client will not encode such metadata, as encodeMetadataHeader just performs a lower suffix check.

… encoded.

Most interfaces for adding metadata to a context downcase keys, except metadata.AppendToOutgoingContext (presumably for performance reasons).  Documentation for metadata.AppendToOutgoingContext, referring to that of metadata.Pairs, states that metadata keys are downcased.

The bug is manifest if you use metadata.AppendToOutgoingContext to add metadata with a non-downcased `-Bin` suffix.  http2Client will not encode such metadata, as encodeMetadataHeader just performs a lower suffix check.
@menghanl menghanl changed the title internal/transport: fix a bug causing -bin metadata to be incorrectly… internal/transport: fix a bug causing -bin metadata to be incorrectly encoded Oct 29, 2020
@GarrettGutierrez1 GarrettGutierrez1 added this to the 1.34 Release milestone Oct 29, 2020
@GarrettGutierrez1 GarrettGutierrez1 merged commit 89faf1c into grpc:master Oct 29, 2020
3 checks passed
davidkhala added a commit to Hyperledger-TWGC/grpc that referenced this issue Dec 7, 2020
… encoded. (grpc#3985)

Most interfaces for adding metadata to a context downcase keys, except metadata.AppendToOutgoingContext (presumably for performance reasons).  Documentation for metadata.AppendToOutgoingContext, referring to that of metadata.Pairs, states that metadata keys are downcased.

The bug is manifest if you use metadata.AppendToOutgoingContext to add metadata with a non-downcased `-Bin` suffix.  http2Client will not encode such metadata, as encodeMetadataHeader just performs a lower suffix check.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants