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

Metadata with non-ASCII characters should panic #1769

Closed
ishitatsuyuki opened this issue Dec 27, 2017 · 2 comments
Closed

Metadata with non-ASCII characters should panic #1769

ishitatsuyuki opened this issue Dec 27, 2017 · 2 comments

Comments

@ishitatsuyuki
Copy link

What version of gRPC are you using?

master (no vendoring)
libprotoc 3.2.0

What version of Go are you using (go version)?

go version go1.9.2 windows/amd64

What did you do?

	header := metadata.Pairs("x-header-key", "unicode")
	trailer := metadata.Pairs("x-trailer-key", "unicode")
	grpc.SendHeader(ctx, header)
	grpc.SetTrailer(ctx, trailer)

What did you expect to see?

This should panic because it violates the HTTP protocol.

What did you see instead?

This didn't panic and sent non compliant response out.

@MakMukhi MakMukhi added P2 P1 and removed P2 labels Dec 28, 2017
@dfawley
Copy link
Member

dfawley commented Jan 4, 2018

Panicking should be avoided if at all possible. SetHeader and SendHeader could return errors. Unfortunately, grpc's ServerStream.SetTrailer doesn't return an error. In this case, one other option would be to make the transport force the stream to result in an error with an error message indicating that the server attempted to send malformed metadata.

@menghanl
Copy link
Contributor

Duplicate of #468

@menghanl menghanl marked this as a duplicate of #468 Jun 13, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants