mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-04 17:22:40 +02:00
all: remove deprecated use of io/ioutil
This commit is contained in:
parent
12d8f92d33
commit
5ffd8db241
6 changed files with 9 additions and 14 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue