]> Cypherpunks.ru repositories - gostls13.git/commit
net/http: make Request.Clone create fresh copies for matches and otherValues
authorJes Cok <xigua67damn@gmail.com>
Wed, 3 Jan 2024 04:18:15 +0000 (04:18 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 3 Jan 2024 17:43:26 +0000 (17:43 +0000)
commit7d1b82dbf108d6cf80f959bb1558f365cee0ec0e
tree75917366ad35f63c2c967cca7c3764b1fdd22254
parentaa0a6ad1db9ea2e338e755720c91e1b10376c4de
net/http: make Request.Clone create fresh copies for matches and otherValues

This change fixes Request.Clone to correctly work with SetPathValue
by creating fresh copies for matches and otherValues so that
SetPathValue for cloned requests doesn't pollute the original request.

While here, also added a doc for Request.SetPathValue.

Fixes #64911

Change-Id: I2831b38e135935dfaea2b939bb9db554c75b65ef
GitHub-Last-Rev: 1981db16475a49fe8d4b874a6bceec64d28a1332
GitHub-Pull-Request: golang/go#64913
Reviewed-on: https://go-review.googlesource.com/c/go/+/553375
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Jes Cok <xigua67damn@gmail.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/net/http/request.go
src/net/http/request_test.go