]> Cypherpunks repositories - gostls13.git/commit
net/http: strip request body headers on POST to GET redirects
authorSean Liao <sean@liao.dev>
Thu, 9 Oct 2025 01:26:02 +0000 (02:26 +0100)
committerGopher Robot <gobot@golang.org>
Fri, 10 Oct 2025 21:39:53 +0000 (14:39 -0700)
commitaced4c79a2b2c60e464410cec1e5378d1011fa18
tree919329b65bab5ca283b9afb128cdc71aa3c199bd
parent584a89fe7455470b09643b30bdc3cc55bb75a552
net/http: strip request body headers on POST to GET redirects

According to WHATWG Fetch, when the body is dropped in a redirect,
headers that describe the body should also be dropped.
https://fetch.spec.whatwg.org/#http-redirect-fetch

Fixes #57273

Change-Id: I84598f69608e95c1b556ea0ce5953ed43bf2d824
Reviewed-on: https://go-review.googlesource.com/c/go/+/710395
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Damien Neil <dneil@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