change set md

This commit is contained in:
Gorbunov Kirill Andreevich 2024-03-18 16:36:08 +03:00
parent 71acc995de
commit 3e79e73eaa

View File

@ -90,9 +90,8 @@ func (h *Handler) Metrics(ctx context.Context, req *codecpb.Frame, rsp *codecpb.
w := io.Writer(buf)
if md, ok := metadata.FromIncomingContext(ctx); gzipAccepted(md) && ok {
if md, ok := metadata.FromOutgoingContext(ctx); gzipAccepted(md) && ok {
md.Set(contentEncodingHeader, "gzip")
ctx = metadata.NewOutgoingContext(ctx, md)
gz := gzipPool.Get().(*gzip.Writer)
defer gzipPool.Put(gz)