hotfix #186

Merged
vtolstov merged 8 commits from kgorbunov/micro-server-http:hotfix into master 2024-03-26 14:53:15 +03:00
Showing only changes of commit 71acc995de - Show all commits

View File

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