0
1
mirror of https://github.com/golang/go synced 2025-02-24 04:05:04 +00:00
Damien Neil 3222951439 [release-branch.go1.22] net/http: send body or close connection on expect-100-continue requests
When sending a request with an "Expect: 100-continue" header,
we must send the request body before sending any further requests
on the connection.

When receiving a non-1xx response to an "Expect: 100-continue" request,
send the request body if the connection isn't being closed after
processing the response. In other words, if either the request
or response contains a "Connection: close" header, then skip sending
the request body (because the connection will not be used for
further requests), but otherwise send it.

Correct a comment on the server-side Expect: 100-continue handling
that implied sending the request body is optional. It isn't.

For #67555
Fixes #68200

Change-Id: Ia2f12091bee697771087f32ac347509ec5922d54
Reviewed-on: https://go-review.googlesource.com/c/go/+/591255
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
(cherry picked from commit cf501e05e138e6911f759a5db786e90b295499b9)
Reviewed-on: https://go-review.googlesource.com/c/go/+/595235
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Joedian Reid <joedian@google.com>
2024-06-26 22:21:31 +00:00
..
2024-01-10 03:29:50 +00:00
2024-01-10 03:29:50 +00:00
2024-01-10 03:29:50 +00:00
2023-11-20 15:56:08 +00:00
2024-01-10 03:29:50 +00:00
2023-04-11 20:54:12 +00:00
2023-11-20 15:56:08 +00:00
2022-11-10 18:46:00 +00:00
2019-10-09 06:14:44 +00:00
2024-01-10 03:29:50 +00:00
2024-01-10 03:29:50 +00:00
2024-01-10 03:29:50 +00:00
2023-09-15 12:57:52 +00:00
2024-01-10 03:29:50 +00:00
2022-04-11 16:34:30 +00:00
2023-04-11 20:54:12 +00:00
2023-09-15 12:57:52 +00:00
2024-01-10 03:29:50 +00:00
2024-01-10 03:29:50 +00:00
2024-01-10 03:29:50 +00:00
2021-11-02 18:35:35 +00:00
2024-01-10 03:29:50 +00:00