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

Headers are lowercased #476

Open
PavelA85 opened this issue Jul 25, 2024 · 1 comment
Open

Headers are lowercased #476

PavelA85 opened this issue Jul 25, 2024 · 1 comment

Comments

@PavelA85
Copy link

Hi,
I try to provide header with -H "isDebug: true" but header name is lowercased with headerName := strings.ToLower(strings.TrimSpace(pieces[0])) during MetadataFromHeaders

Any reason for this behavior?

@jhump
Copy link
Contributor

jhump commented Jul 26, 2024

@PavelA85, metadata keys in gRPC (and in HTTP headers) are case-insensitive. In HTTP/2, they are always transmitted in lower-case. This lower-casing is done because the keys in a metadata.MD map must always be lower-case. Since this code is directly creating the map (instead of using methods on the metadata.MD type), it must make sure they are correctly canonicalized. Also see the relevant grpc-go docs.

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

No branches or pull requests

2 participants