all: remove deprecated use of io/ioutil

This commit is contained in:
Will Norris 2023-01-31 20:30:38 -08:00
parent 12d8f92d33
commit 5ffd8db241
6 changed files with 9 additions and 14 deletions

View file

@ -14,7 +14,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"mime"
"net"
@ -242,7 +241,7 @@ func (p *Proxy) serveImage(w http.ResponseWriter, r *http.Request) {
if contentType == "" || contentType == "application/octet-stream" || contentType == "binary/octet-stream" {
// try to detect content type
b := bufio.NewReader(resp.Body)
resp.Body = ioutil.NopCloser(b)
resp.Body = io.NopCloser(b)
contentType = peekContentType(b)
}
if resp.ContentLength != 0 && !contentTypeMatches(p.ContentTypes, contentType) {
@ -497,7 +496,7 @@ func (t *TransformingTransport) RoundTrip(req *http.Request) (*http.Response, er
return &http.Response{StatusCode: http.StatusNotModified}, nil
}
b, err := ioutil.ReadAll(resp.Body)
b, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}