client: set grpc-accept-encoding header based on outgoing compressor (#3139)

This commit is contained in:
Jiacai Liu
2019-11-19 01:44:48 +08:00
committed by Doug Fawley
parent 347a6b4db3
commit 967379b15b

View File

@ -424,6 +424,7 @@ func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr)
if callHdr.SendCompress != "" {
headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-encoding", Value: callHdr.SendCompress})
headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-accept-encoding", Value: callHdr.SendCompress})
}
if dl, ok := ctx.Deadline(); ok {
// Send out timeout regardless its value. The server can detect timeout context by itself.