Validate that ASCII Metadata values contain only printable ASCII Characters #11696
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To tackle grpc/grpc-go#468, in grpc/grpc-go#4886, a stricter validation on ASCII Metadata values was introduced to throw if the value contains any non-printable ASCII characters, that is characters outside of the range 0x20 to 0x7E.
The current grpc-java behavior regarding that is:
?
when putting the entry into the Metadata instance.\t
for example.This pull request fixes the inconsistent behavior among grpc-java and grpc-go and closes #11679.
Notice that with this pull request, previously passing ASCII Metadata values, will now observe
IllegalArgumentException
s therefore this is a breaking change.