From 0bd008f5fadb62d228f12b18d016709e8139a7af Mon Sep 17 00:00:00 2001 From: dfawley Date: Thu, 25 Jan 2018 13:54:11 -0800 Subject: [PATCH] stats: Fix bug causing trailers-only responses to be reported as headers (#1817) --- transport/http2_client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transport/http2_client.go b/transport/http2_client.go index 3dce30f6..9eb85824 100644 --- a/transport/http2_client.go +++ b/transport/http2_client.go @@ -1118,8 +1118,9 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { s.mu.Lock() if !s.headerDone { - // Headers frame is not actually a trailers-only frame. if !endStream { + // Headers frame is not actually a trailers-only frame. + isHeader = true s.recvCompress = state.encoding if len(state.mdata) > 0 { s.header = state.mdata @@ -1127,7 +1128,6 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { } close(s.headerChan) s.headerDone = true - isHeader = true } if !endStream || s.state == streamDone { s.mu.Unlock()