]> Cypherpunks repositories - gostls13.git/commit
net/http: limit 1xx based on size, do not limit when delivered
authorDamien Neil <dneil@google.com>
Mon, 23 Sep 2024 18:43:19 +0000 (11:43 -0700)
committerDamien Neil <dneil@google.com>
Thu, 24 Oct 2024 16:10:37 +0000 (16:10 +0000)
commitbf2aa6c233b0a1edca796fd78a02fef0f0251d5e
tree6eb9c854754ba8a895f3c830fc7956a6384c0366
parent76f320836720635b30896d91493c02c1f9578cca
net/http: limit 1xx based on size, do not limit when delivered

Replace Transport's limit of 5 1xx responses with a limit based
on MaxResponseHeaderBytes: The total number of responses
(including 1xx reponses and the final response) must not exceed
this value.

When the user is reading 1xx responses using a Got1xxResponse
client trace hook, disable the limit: Each 1xx response is
individually limited by MaxResponseHeaderBytes, but there
is no limit on the total number of responses. The user is
responsible for imposing a limit if they want one.

For #65035

Change-Id: If4bbbbb0b808cb5016701d50963c89f0ce1229f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/615255
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/net/http/transport.go
src/net/http/transport_test.go