nodejs sends %-encoded grpc message trailers, and envoy does not decode them when transcoding to json
This shows the issue: we're hitting a nodejs grpc upstream (using https://www.npmjs.com/package/@grpc/grpc-js), with envoy doing the json transcoding.
curl -v -H 'cluster: echojs' http://127.0.0.1:8180/echo/echo
{"code":5,"message":"#%20node:%20here's%20an%20error%20message%20with%20spaces%20&%20some%20interesting%20characters!","details":[]}* Closing connection 0
node returns %-encoded headers, but this is apparently expected as eg. grpcurl
decodes before printing. Envoy should do this decoding as well.
This commit seems to fix the issue: https://github.com/kentik/envoy/commit/d1b24e225039c0ea98f6fe7f62c9ae83b7ca655b
The same call to a go upstream looks fine (b/c the go grpc impl doesn't percent encode grpc status message headers)
curl -v -H 'cluster: echo' http://127.0.0.1:8180/echo/echo
{"code":5,"message":"# here's an error message with spaces & some interesting characters!","details":[]}
Node:
Header: grpc-message: #%20node:%20here's%20an%20error%20message%20with%20spaces%20&%20some%20interesting%20characters!
Go:
Header: grpc-message: # here's an error message with spaces & some interesting characters!
See go.pcap, node.pcap and Decode.md
grpcurl -H 'cluster: echojs' -plaintext -protoset echo/proto.pb localhost:8180 grpcecho.EchoService.Echo
ERROR:
Code: NotFound
Message: # node: here's an error message with spaces & some interesting characters!
grpcurl -H 'cluster: echo' -plaintext -protoset echo/proto.pb localhost:8180 grpcecho.EchoService.Echo
ERROR:
Code: NotFound
Message: # here's an error message with spaces & some interesting characters!
grpcurl -plaintext -protoset echo/proto.pb localhost:8998 grpcecho.EchoService.Echo
ERROR:
Code: NotFound
Message: # node: here's an error message with spaces & some interesting characters!
grpcurl -plaintext -protoset echo/proto.pb localhost:8999 grpcecho.EchoService.Echo
ERROR:
Code: NotFound
Message: # here's an error message with spaces & some interesting characters!