-
Notifications
You must be signed in to change notification settings - Fork 513
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
add encoding flag to allow specifying compression as identity #444
Conversation
Wait... are you saying that currently, grpcurl always uses gzip on requests? |
I couldn't get it not to use gzip, but it could be my malfunctioning server. I'm ok using using my fork with this fix for now, so I don't need it merged in a rush. I can dig deeper to figure out if it's a encoding negotiation issue. I used wireshark and only saw gzip being sent and quickly did this workaround. |
I'd just like to get to the bottom of things before we commit something! I'm not sure ordinary grpcurl really needs a gzip option, so if the actual issue is "grpcurl unexpectedly sends gzip", we should identify that. AFAIK registering the gzip compressor is mostly to support servers which (for whatever reason) decide to send a gzip response back. |
That makes sense. I'll fire up wireshark and grab the headers again to confirm the behavior. I think what I remember seeing was that the grpc-encoding header was always gzip without telling it to use identity. If that's the case, and the go client doesn't do automatic compression fallback for the request body, the flag is still useful. I also would find it useful to be able to ensure that the request is using the right encoding for reproducing issues locally that could be compression related. |
In the linked PR (124), that does not cause IIUC, in order to actually compress a request with the When you say you are seeing |
Is a flag even needed though? You said you misunderstood the original situation. So, now that the original situation is understood, is it likely that no change is needed in |
Maybe I'm missing something. Is there a way currently to send a gzipped request? It seems that the tool always sends an uncompressed request and receives a (potentially) compressed one. If not, my change is still useful to me for now to test support for compressed and uncompressed calls independently (as one would with curl's |
There is not. I guess what's unclear is why that's needed. And from your last reply, it sounds like the answer is "to test server implementations' compression support"
FWIW, this flag does not compress requests. It only requests compressed responses, just like
|
Yea I wasn't trying to be pedantic about it, just pointing out a flag on curl that can be used in a similar fashion, even if it doesn't map exactly to what I'm looking for. There are other flags and headers that can be used to control request encoding. I'll accept this is a limitation of this cli that it doesn't intend to expose similar control. |
👍 thanks for hashing this out! |
Gzip encoding was added in #124. By default the go client will only use this encoder for all requests and not send the
identity
encoder value. I'm testing a dev server that doesn't have gzip encoding implemented yet, so would like to send requests usingidentity
. This new optional flagencoding
sends the expectedgrpc-encoding
andgrpc-accept-encoding
headers. In the case of identity, thegrpc-encoding
header only includesidentity
, while thegrpc-accept-encoding
header includes identity and gzip, so the server can still respond with gzip if it chooses when identity is passed.