summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy/fastcgi
diff options
context:
space:
mode:
authorKallyDev <36319157+kallydev@users.noreply.github.com>2021-09-30 01:17:48 +0800
committerGitHub <noreply@github.com>2021-09-29 11:17:48 -0600
commitc48fadc4a7655008d13076c7f757c36368e2ca13 (patch)
tree3fe2837e02e9b664dd5b86afbe42494ac20997f8 /modules/caddyhttp/reverseproxy/fastcgi
parent059fc32f002d00e980b438b3edbdf7b8bcdf9a90 (diff)
Move from deprecated ioutil to os and io packages (#4364)
Diffstat (limited to 'modules/caddyhttp/reverseproxy/fastcgi')
-rw-r--r--modules/caddyhttp/reverseproxy/fastcgi/client.go3
-rw-r--r--modules/caddyhttp/reverseproxy/fastcgi/client_test.go3
2 files changed, 2 insertions, 4 deletions
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/client.go b/modules/caddyhttp/reverseproxy/fastcgi/client.go
index 94df0c7..0772053 100644
--- a/modules/caddyhttp/reverseproxy/fastcgi/client.go
+++ b/modules/caddyhttp/reverseproxy/fastcgi/client.go
@@ -30,7 +30,6 @@ import (
"encoding/binary"
"errors"
"io"
- "io/ioutil"
"mime/multipart"
"net"
"net/http"
@@ -445,7 +444,7 @@ func (c *FCGIClient) Request(p map[string]string, req io.Reader) (resp *http.Res
if chunked(resp.TransferEncoding) {
resp.Body = clientCloser{c, httputil.NewChunkedReader(rb)}
} else {
- resp.Body = clientCloser{c, ioutil.NopCloser(rb)}
+ resp.Body = clientCloser{c, io.NopCloser(rb)}
}
return
}
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/client_test.go b/modules/caddyhttp/reverseproxy/fastcgi/client_test.go
index f0740a4..ef3474d 100644
--- a/modules/caddyhttp/reverseproxy/fastcgi/client_test.go
+++ b/modules/caddyhttp/reverseproxy/fastcgi/client_test.go
@@ -26,7 +26,6 @@ import (
"encoding/binary"
"fmt"
"io"
- "io/ioutil"
"log"
"math/rand"
"net"
@@ -166,7 +165,7 @@ func sendFcgi(reqType int, fcgiParams map[string]string, data []byte, posts map[
}
defer resp.Body.Close()
- content, _ = ioutil.ReadAll(resp.Body)
+ content, _ = io.ReadAll(resp.Body)
log.Println("c: send data length ≈", length, string(content))
fcgi.Close()