mirror of
https://github.com/kataras/iris.git
synced 2025-12-22 12:27:02 +00:00
replace ioutil with io package and other minor improvements
This commit is contained in:
6
cache/client/client.go
vendored
6
cache/client/client.go
vendored
@@ -2,7 +2,7 @@ package client
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
@@ -17,8 +17,8 @@ import (
|
||||
// register one client handler per route.
|
||||
//
|
||||
// it's just calls a remote cache service server/handler,
|
||||
// which lives on other, external machine.
|
||||
//
|
||||
// which lives on other, external machine.
|
||||
type ClientHandler struct {
|
||||
// bodyHandler the original route's handler
|
||||
bodyHandler context.Handler
|
||||
@@ -162,7 +162,7 @@ func (h *ClientHandler) ServeHTTP(ctx *context.Context) {
|
||||
// get the status code , content type and the write the response body
|
||||
ctx.ContentType(response.Header.Get(cfg.ContentTypeHeader))
|
||||
ctx.StatusCode(response.StatusCode)
|
||||
responseBody, err := ioutil.ReadAll(response.Body)
|
||||
responseBody, err := io.ReadAll(response.Body)
|
||||
response.Body.Close()
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user