remove deprecated use of ioutil (#5205)

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2022-12-08 14:44:53 +01:00
committed by GitHub
parent 46cb910637
commit 53d15d329e
24 changed files with 57 additions and 67 deletions
@@ -3,7 +3,6 @@ package middleware
import (
"fmt"
"io"
"io/ioutil"
"net/http"
"regexp"
"strings"
@@ -113,7 +112,7 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle
// https://github.com/golang/go/issues/15527
defer r.Body.Close()
_, _ = io.Copy(ioutil.Discard, r.Body)
_, _ = io.Copy(io.Discard, r.Body)
}
})
}
+2 -2
View File
@@ -3,7 +3,7 @@ package middleware
import (
"context"
"encoding/json"
"io/ioutil"
"io"
"net/http"
"strings"
"sync"
@@ -181,7 +181,7 @@ func (m *OIDCAuthenticator) getKeyfunc() *keyfunc.JWKS {
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
m.Logger.Error().Err(err).Msg("unable to read discovery response body")
return nil