1
0
Fork 0

Update to go1.16

This commit is contained in:
Romain 2021-03-04 20:08:03 +01:00 committed by GitHub
parent 2e7833df49
commit bdba7d3adf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 217 additions and 318 deletions

View file

@ -4,7 +4,7 @@ import (
"bufio"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net"
"net/http"
@ -73,12 +73,12 @@ func (r *retry) GetTracingInformation() (string, ext.SpanKindEnum) {
}
func (r *retry) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
// if we might make multiple attempts, swap the body for an ioutil.NopCloser
// if we might make multiple attempts, swap the body for an io.NopCloser
// cf https://github.com/traefik/traefik/issues/1008
if r.attempts > 1 {
body := req.Body
defer body.Close()
req.Body = ioutil.NopCloser(body)
req.Body = io.NopCloser(body)
}
attempts := 1