net/http: Request.Clone does not clone path values #64911
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
Go version
go version go1.22rc1 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
I tried using the new
Request.PathValue
andRequest.SetPathValue
methods introduced in #61410 together withRequest.Clone
.Code:
Playground Link: https://go.dev/play/p/gz8wPsLmz6u?v=gotip
What did you expect to see?
Request.Clone
s documentation statesThus I expect calls to
SetPathValue
on one request object to not affect the values returned byPathValue
on the other request object.What did you see instead?
Changes to the path values of one request also affect the other. See the example code and the playground example.
The reason for this is that
Clone
does not create copies ofr.matches
andr.otherValues
.The text was updated successfully, but these errors were encountered: