44 "bytes"
55 "compress/gzip"
66 "errors"
7- "io/ioutil "
7+ "io"
88 "net/http"
99 "net/http/httptest"
1010 "strings"
@@ -39,7 +39,7 @@ func TestDecompress(t *testing.T) {
3939 c = e .NewContext (req , rec )
4040 h (c )
4141 assert .Equal (t , GZIPEncoding , req .Header .Get (echo .HeaderContentEncoding ))
42- b , err := ioutil .ReadAll (req .Body )
42+ b , err := io .ReadAll (req .Body )
4343 assert .NoError (t , err )
4444 assert .Equal (t , body , string (b ))
4545}
@@ -67,7 +67,7 @@ func TestDecompressDefaultConfig(t *testing.T) {
6767 c = e .NewContext (req , rec )
6868 h (c )
6969 assert .Equal (t , GZIPEncoding , req .Header .Get (echo .HeaderContentEncoding ))
70- b , err := ioutil .ReadAll (req .Body )
70+ b , err := io .ReadAll (req .Body )
7171 assert .NoError (t , err )
7272 assert .Equal (t , body , string (b ))
7373}
@@ -82,7 +82,7 @@ func TestCompressRequestWithoutDecompressMiddleware(t *testing.T) {
8282 e .NewContext (req , rec )
8383 e .ServeHTTP (rec , req )
8484 assert .Equal (t , GZIPEncoding , req .Header .Get (echo .HeaderContentEncoding ))
85- b , err := ioutil .ReadAll (req .Body )
85+ b , err := io .ReadAll (req .Body )
8686 assert .NoError (t , err )
8787 assert .NotEqual (t , b , body )
8888 assert .Equal (t , b , gz )
@@ -132,7 +132,7 @@ func TestDecompressSkipper(t *testing.T) {
132132 c := e .NewContext (req , rec )
133133 e .ServeHTTP (rec , req )
134134 assert .Equal (t , rec .Header ().Get (echo .HeaderContentType ), echo .MIMEApplicationJSONCharsetUTF8 )
135- reqBody , err := ioutil .ReadAll (c .Request ().Body )
135+ reqBody , err := io .ReadAll (c .Request ().Body )
136136 assert .NoError (t , err )
137137 assert .Equal (t , body , string (reqBody ))
138138}
@@ -161,7 +161,7 @@ func TestDecompressPoolError(t *testing.T) {
161161 c := e .NewContext (req , rec )
162162 e .ServeHTTP (rec , req )
163163 assert .Equal (t , GZIPEncoding , req .Header .Get (echo .HeaderContentEncoding ))
164- reqBody , err := ioutil .ReadAll (c .Request ().Body )
164+ reqBody , err := io .ReadAll (c .Request ().Body )
165165 assert .NoError (t , err )
166166 assert .Equal (t , body , string (reqBody ))
167167 assert .Equal (t , rec .Code , http .StatusInternalServerError )
0 commit comments