net/http: request.Clone doesn't deep copy TransferEncoding #41907
Comments
Change https://golang.org/cl/261258 mentions this issue: |
Thank you for catching this @dqu123 and welcome to the Go project! Good eyes. @gopherbot please backport this issue. |
This was referenced Oct 10, 2020
Backport issue(s) opened: #41913 (for 1.14), #41914 (for 1.15). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/261377 mentions this issue: |
Change https://golang.org/cl/261378 mentions this issue: |
gopherbot
pushed a commit
that referenced
this issue
Oct 23, 2020
The existing implementation in Request.Clone() assigns the wrong pointer to r2.TransferEncoding. Updates #41907. Fixes #41914. Change-Id: I7f220a41b1b46a55d1a1005e47c6dd69478cb025 Reviewed-on: https://go-review.googlesource.com/c/go/+/261378 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Carlos Amedee <carlos@golang.org> Trust: Emmanuel Odeke <emm.odeke@gmail.com>
gopherbot
pushed a commit
that referenced
this issue
Oct 23, 2020
The existing implementation in Request.Clone() assigns the wrong pointer to r2.TransferEncoding. Updates #41907. Fixes #41913. Change-Id: I7f220a41b1b46a55d1a1005e47c6dd69478cb025 Reviewed-on: https://go-review.googlesource.com/c/go/+/261377 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Carlos Amedee <carlos@golang.org> Trust: Emmanuel Odeke <emm.odeke@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes, bug exists in master: https://github.com/golang/go/blob/master/src/net/http/request.go#L385
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/aSFm22u_TGZ
What did you expect to see?
cloned request TransferEncoding should not changed by changes to the original request after it has been copied.
What did you see instead?
cloned request TransferEncoding was modified by changing original request TransferEncoding
The text was updated successfully, but these errors were encountered: