clear dst bodyRaw before copy (#1476)

This commit is contained in:
tyltr
2023-01-23 12:07:21 +08:00
committed by GitHub
parent e87f84c51a
commit eef368eb8d
+1 -1
View File
@@ -771,7 +771,7 @@ func (req *Request) ResetBody() {
func (req *Request) CopyTo(dst *Request) {
req.copyToSkipBody(dst)
if req.bodyRaw != nil {
dst.bodyRaw = append(dst.bodyRaw, req.bodyRaw...)
dst.bodyRaw = append(dst.bodyRaw[:0], req.bodyRaw...)
if dst.body != nil {
dst.body.Reset()
}