Skip to content

Commit

Permalink
Do not copy body stream in Request.CopyTo to be consistent with Respo…
Browse files Browse the repository at this point in the history
…nse.CopyTo
  • Loading branch information
valyala committed Feb 14, 2016
1 parent a8c4ad4 commit 83e1796
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,11 @@ func (req *Request) ResetBody() {
req.body = req.body[:0]
}

// CopyTo copies req contents to dst.
// CopyTo copies req contents to dst except of body stream.
func (req *Request) CopyTo(dst *Request) {
dst.Reset()
req.Header.CopyTo(&dst.Header)
dst.body = append(dst.body[:0], req.Body()...)
dst.body = append(dst.body[:0], req.body...)

req.uri.CopyTo(&dst.uri)
dst.parsedURI = req.parsedURI
Expand Down

0 comments on commit 83e1796

Please sign in to comment.