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

Validate that ASCII Metadata values contain only printable ASCII Characters #11696

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CoolTomatos
Copy link

@CoolTomatos CoolTomatos commented Nov 15, 2024

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 entries to a Metadata instance:
    • Any non ASCII character is silently replaced with ?;
    • Any ASCII character is kept and marshaled as it is, this includes non-printable ones like \t for example.
  • When sending the Metadata instance:
    • Entires where the value contains non-printable ASCII are logged and dropped.

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 IllegalArgumentExceptions therefore this is a breaking change.

Copy link

linux-foundation-easycla bot commented Nov 15, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@CoolTomatos CoolTomatos marked this pull request as draft November 15, 2024 14:13
@CoolTomatos CoolTomatos marked this pull request as ready for review November 19, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata: Header value validation
1 participant