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

Improve error message with invalid headers #2068

Merged

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Mar 9, 2023

Fixes grpc/grpc#32577

The error message makes debugging which trailer has an invalid character easier.

Copy link
Contributor

@mgravell mgravell left a comment

Choose a reason for hiding this comment

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

LGTM; question, though - how do headers behave? Do we already get similar logging with invalid headers? And headers/trailers sent by the client?

@JamesNK
Copy link
Member Author

JamesNK commented Mar 9, 2023

An error from an incoming header is less likely. That happening means the HTTP client has to have allowed sending an invalid header. Also, there isn't much to do about it in gRPC because Kestrel rejects the request before gRPC runs.

Good point about invalid response header. Added same logic there.

@JamesNK JamesNK changed the title Improve error message with invalid trailer Improve error message with invalid headers Mar 9, 2023
@JamesNK JamesNK merged commit 95cf7fc into grpc:master Mar 9, 2023
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.

gRPC call throws Invalid non-ASCII or control character in header: 0x0011 when request contains url
2 participants