]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document that Request.Clone does not deep copy Body
authorDamien Neil <dneil@google.com>
Mon, 17 Jun 2024 21:54:22 +0000 (14:54 -0700)
committerDamien Neil <dneil@google.com>
Mon, 24 Jun 2024 17:21:49 +0000 (17:21 +0000)
Fixes #36095

Change-Id: I94ae014b0ee45b4aeb38cb247e42cfc13f663ded
Reviewed-on: https://go-review.googlesource.com/c/go/+/593175
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
src/net/http/request.go

index 456615a79ad59b7e95eff0d69d2c7f03ac850a25..ad1b5a620b07ae1d6145ee1bcc7a1fc0f7158d27 100644 (file)
@@ -377,6 +377,8 @@ func (r *Request) WithContext(ctx context.Context) *Request {
 // Clone returns a deep copy of r with its context changed to ctx.
 // The provided ctx must be non-nil.
 //
+// Clone only makes a shallow copy of the Body field.
+//
 // For an outgoing client request, the context controls the entire
 // lifetime of a request and its response: obtaining a connection,
 // sending the request, and reading the response headers and body.