reconcile grpcui cmd-line options with grpcurl #163
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds several command-line options to
grpcui
that are already available ingrpcurl
:-H
,-rpc-header
: These allow adding extra metadata to all requests, in addition to what the user enters in the web form UI. The difference is that-H
headers will also be added to reflection requests.-expand-headers
: This allows for safe use of secrets in metadata by putting them in environment variables instead of on the command-line-use-reflection
: This allows using both server reflection and proto sources, which can be useful to add extra descriptors that the server may not know about for resolving extensions andgoogle.protobuf.Any
messages.This also adds a new, related option:
-preserve-header
: This allows for propagating headers from the invocation request (which could include headers added by a client/browser/user agent as well as proxies in between the client and the grpcui server) to request metadata on the invoked RPC.Finally, this PR fixes the HTTP response output when using the
-vvv
"very very verbose" log output. Before this change, binary data is written to the output as raw bytes. When the output is a terminal, this can cause undesirable behavior since some sequences of raw bytes may be interpreted as control/escape sequences. Now, binary output for HTTP responses is encoded in hex.Fixes #111 and #126.
This should also help with #99.