New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
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: |
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>
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>
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: