From 7f2582e3b65d9b39980af019300148e7183a78c2 Mon Sep 17 00:00:00 2001 From: SALLEYRON Julien Date: Thu, 12 Oct 2017 15:10:04 +0200 Subject: [PATCH] Nil body retries --- glide.lock | 4 ++-- glide.yaml | 2 +- vendor/github.com/vulcand/oxy/forward/fwd.go | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/glide.lock b/glide.lock index 94577fae0..990a41429 100644 --- a/glide.lock +++ b/glide.lock @@ -1,4 +1,4 @@ -hash: 9d176906cf25eaa3224c750b1dd3a5c8ce3340a58df3c562e57572c6294e16f0 +hash: d87c01b4b8f802c81e1f3ae34a09c7001dc392654703b53fe0e6722041183abc updated: 2017-09-30T18:32:16.848940186+02:00 imports: - name: cloud.google.com/go @@ -481,7 +481,7 @@ imports: - name: github.com/urfave/negroni version: 490e6a555d47ca891a89a150d0c1ef3922dfffe9 - name: github.com/vulcand/oxy - version: 648088ee0902cf8d8337826ae2a82444008720e2 + version: c024a22700b56debed9a9c8dbb297210a7ece02d repo: https://github.com/containous/oxy.git vcs: git subpackages: diff --git a/glide.yaml b/glide.yaml index e6817d4d8..d48639846 100644 --- a/glide.yaml +++ b/glide.yaml @@ -12,7 +12,7 @@ import: - package: github.com/cenk/backoff - package: github.com/containous/flaeg - package: github.com/vulcand/oxy - version: 648088ee0902cf8d8337826ae2a82444008720e2 + version: c024a22700b56debed9a9c8dbb297210a7ece02d repo: https://github.com/containous/oxy.git vcs: git subpackages: diff --git a/vendor/github.com/vulcand/oxy/forward/fwd.go b/vendor/github.com/vulcand/oxy/forward/fwd.go index a30c76ba0..09225f4c6 100644 --- a/vendor/github.com/vulcand/oxy/forward/fwd.go +++ b/vendor/github.com/vulcand/oxy/forward/fwd.go @@ -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 }