Skip to content

Commit

Permalink
clear dst bodyRaw before copy (#1476)
Browse files Browse the repository at this point in the history
  • Loading branch information
tylitianrui committed Jan 23, 2023
1 parent e87f84c commit eef368e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit eef368e

Please sign in to comment.