diff options
Diffstat (limited to 'src/net/http/internal/http2/write.go')
| -rw-r--r-- | src/net/http/internal/http2/write.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/net/http/internal/http2/write.go b/src/net/http/internal/http2/write.go index 59c4e625a5..5e6f810c41 100644 --- a/src/net/http/internal/http2/write.go +++ b/src/net/http/internal/http2/write.go @@ -10,6 +10,8 @@ import ( "log" "net/http/internal/httpcommon" "net/url" + "strconv" + "strings" "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" @@ -200,7 +202,7 @@ type writeResHeaders struct { func encKV(enc *hpack.Encoder, k, v string) { if VerboseLogs { - log.Printf("http2: server encoding header %q = %q", k, v) + log.Printf("http2: server encoding header %q = %q", strings.Clone(k), strings.Clone(v)) } enc.WriteField(hpack.HeaderField{Name: k, Value: v}) } @@ -221,7 +223,8 @@ func (w *writeResHeaders) writeFrame(ctx writeContext) error { buf.Reset() if w.httpResCode != 0 { - encKV(enc, ":status", httpCodeString(w.httpResCode)) + codeBuf := strconv.AppendInt(make([]byte, 0, 3), int64(w.httpResCode), 10) + encKV(enc, ":status", string(codeBuf)) } encodeHeaders(enc, w.h, w.trailers) |
