]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.24] net/http: don't modify caller's tls.Config.NextProtos
authorDamien Neil <dneil@google.com>
Tue, 4 Mar 2025 23:20:28 +0000 (15:20 -0800)
committerCherry Mui <cherryyz@google.com>
Mon, 17 Mar 2025 21:37:18 +0000 (14:37 -0700)
commitfd29397dca4f393a8a9ce6e9c952fa292e07a7f0
tree13bdcc23ff24a0b54ce4f83751d29552f982c6df
parent4524009ba6daed1b0f0a800b90f5d3eecb7a395e
[release-branch.go1.24] net/http: don't modify caller's tls.Config.NextProtos

Clone the input slice before adjusting NextProtos
to add or remove "http/1.1" and "h2" entries,
so as not to modify a slice that the caller might be using.
(We clone the tls.Config that contains the slice, but
that's a shallow clone.)

For #72100
Fixes #72103

Change-Id: I9f228b8fb6f6f2ca5023179ec114929c002dbda9
Reviewed-on: https://go-review.googlesource.com/c/go/+/654875
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/657215
src/net/http/serve_test.go
src/net/http/server.go