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

if there a flag set the metadata first letter not change to uppower #1830

Closed
damozhiying opened this issue Nov 20, 2020 · 1 comment
Closed

Comments

@damozhiying
Copy link

if there a flag,set the metadata first letter not change to uppower,

grpc.SetHeader(ctx, metadata.Pairs("Grpc-Metadata-Some-Key", "222222222xxxxxxxxxx"))
	grpc.SetHeader(ctx, metadata.Pairs("WWW-Authenticate", "222222222xxxxxxxxxx"))
	grpc.SendHeader(ctx, metadata.Pairs("ABC-WWW-Authenticate", "222222222xxxxxxxxxx"))

browser f12 show

Content-Type →application/json
Lxf--Abc-Www-Authenticate →222222222xxxxxxxxxx
Lxf--Content-Type →application/grpc
Lxf--Grpc-Metadata-Some-Key →222222222xxxxxxxxxx
Lxf--Www-Authenticate →222222222xxxxxxxxxx

i need not change the header key ,is there a method?

@johanbrandhorst
Copy link
Collaborator

HTTP headers are case-insensitive according to the spec: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html. We use the Go standard library to produce the HTTP headers, but trying to produce case sensitive headers is not going to work, I'm afraid. Certain proxies will rewrite all headers to be lower case (envoy does this).

Closing as we can't/won't change this in the grpc-gateway.

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