diff --git a/autorest/retriablerequest_1.7.go b/autorest/retriablerequest_1.7.go index 3c2eb10ee..8340bda40 100644 --- a/autorest/retriablerequest_1.7.go +++ b/autorest/retriablerequest_1.7.go @@ -33,7 +33,7 @@ type RetriableRequest struct { func (rr *RetriableRequest) Prepare() (err error) { // preserve the request body; this is to support retry logic as // the underlying transport will always close the reqeust body - if rr.req.Body != nil { + if rr.req.Body != nil && rr.req.Body != http.NoBody { if rr.br != nil { _, err = rr.br.Seek(0, 0 /*io.SeekStart*/) rr.req.Body = io.NopCloser(rr.br) diff --git a/autorest/retriablerequest_1.8.go b/autorest/retriablerequest_1.8.go index 0bd3c8ba4..e36d4b046 100644 --- a/autorest/retriablerequest_1.8.go +++ b/autorest/retriablerequest_1.8.go @@ -34,7 +34,7 @@ type RetriableRequest struct { func (rr *RetriableRequest) Prepare() (err error) { // preserve the request body; this is to support retry logic as // the underlying transport will always close the reqeust body - if rr.req.Body != nil { + if rr.req.Body != nil && rr.req.Body != http.NoBody { if rr.rc != nil { rr.req.Body = rr.rc } else if rr.br != nil {