Explorar o código

Reset response buffer

DarthSim %!s(int64=6) %!d(string=hai) anos
pai
achega
fe4810609a
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      server.go

+ 1 - 0
server.go

@@ -112,6 +112,7 @@ func respondWithImage(ctx context.Context, reqID string, r *http.Request, rw htt
 		rw.Header().Set("Content-Encoding", "gzip")
 
 		buf := responseBufPool.Get().(*bytes.Buffer)
+		buf.Reset()
 		defer responseBufPool.Put(buf)
 
 		gzipData(data, buf)