Nil body retries

This commit is contained in:
SALLEYRON Julien 2017-10-12 15:10:04 +02:00 committed by Traefiker
parent dbc796359f
commit 7f2582e3b6
3 changed files with 9 additions and 3 deletions

View file

@ -249,6 +249,12 @@ func (f *httpForwarder) copyRequest(req *http.Request, u *url.URL) *http.Request
if f.rewriter != nil {
f.rewriter.Rewrite(outReq)
}
if req.ContentLength == 0 {
// https://github.com/golang/go/issues/16036: nil Body for http.Transport retries
outReq.Body = nil
}
return outReq
}