]> Cypherpunks repositories - gostls13.git/commit
net/http: set cookie host to Request.Host when available
authorSean Liao <sean@liao.dev>
Wed, 8 Oct 2025 21:33:24 +0000 (22:33 +0100)
committerGopher Robot <gobot@golang.org>
Fri, 10 Oct 2025 21:38:20 +0000 (14:38 -0700)
commit69e82796322bbff60b522534a8a6eacb2bf1ebba
tree57dee1f0f5ad55930b88371a580e0952175d7c9d
parent6f4c63ba63fdec6e4a42e2e19ac71937973dedef
net/http: set cookie host to Request.Host when available

When both Request.URL and Request.Host are set, the host in URL
is used for connecting at the transport level, while Host is used
for the request host line. Cookies should be set for the request,
not the underlying connection destination.

Fixes #38988

Change-Id: I09053b87ccac67081f6038d205837d9763701526
Reviewed-on: https://go-review.googlesource.com/c/go/+/710335
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/net/http/client.go
src/net/http/client_test.go