]> Cypherpunks repositories - gostls13.git/commit
net/http: don't retry Transport requests if they have a body
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 8 Dec 2016 01:07:10 +0000 (01:07 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 8 Dec 2016 21:08:00 +0000 (21:08 +0000)
commit9296d4efe72de89b40425e7426545d6608f2e2d0
treef612b8428256201fe0bd0117fb61c9896d9042ae
parent67b292799051f7423cc15154d5fc8bb9c57e7057
net/http: don't retry Transport requests if they have a body

This rolls back https://golang.org/cl/27117 partly, softening it so it
only retries POST/PUT/DELETE etc requests where there's no Body (nil
or NoBody). This is a little useless, since most idempotent requests
have a body (except maybe DELETE), but it's late in the Go 1.8 release
cycle and I want to do the proper fix.

The proper fix will look like what we did for http2 and only retrying
the request if Request.GetBody is defined, and then creating a new request
for the next attempt. See https://golang.org/cl/33971 for the http2 fix.

Updates #15723
Fixes #18239
Updates #18241

Change-Id: I6ebaa1fd9b19b5ccb23c8d9e7b3b236e71cf57f3
Reviewed-on: https://go-review.googlesource.com/34134
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
doc/go1.8.html
src/net/http/client_test.go
src/net/http/transport.go