Skip to content

Never encode binary metadata within the metadata map#1188

Merged
dfawley merged 2 commits intogrpc:masterfrom
dfawley:metadata_bin2
Apr 28, 2017
Merged

Never encode binary metadata within the metadata map#1188
dfawley merged 2 commits intogrpc:masterfrom
dfawley:metadata_bin2

Conversation

@dfawley
Copy link
Copy Markdown
Member

@dfawley dfawley commented Apr 17, 2017

This change ensures consistency for the user when accessing metadata values: they are never encoded except when sent on the wire. Previously, they would appear encoded to client code, but not to server code. As such, this represents a behavior change, but one unlikely to affect user code, as it's unusual to inspect the metadata after setting it.

Fixes the remaining aspect of #1148 not fixed by #1157.

This change ensures consistency for the user when accessing metadata values:
they are never encoded except when sent on the wire.  Previously, they would
appear encoded to client code, but not to server code.  As such, this
represents a behavior change, but one unlikely to affect user code, as it's
unusual to inspect the metadata after setting it.
@dfawley dfawley added 1.3 Type: API Change Breaking API changes (experimental APIs only!) labels Apr 17, 2017
@dfawley dfawley requested review from MakMukhi and menghanl April 26, 2017 16:41
Comment thread metadata/metadata_test.go

const binaryValue = string(128)

func TestEncodeKeyValue(t *testing.T) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Move these two tests to http_util_test.go instead of deleting them?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good idea. Done.

@dfawley dfawley merged commit b610ffd into grpc:master Apr 28, 2017
@dfawley dfawley deleted the metadata_bin2 branch July 25, 2017 17:23
@lock lock Bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Type: API Change Breaking API changes (experimental APIs only!)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants