1
0
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:
Gerasimos (Makis) Maropoulos
2022-06-17 22:03:18 +03:00
parent 20d2855a66
commit ef2643b046
108 changed files with 1069 additions and 1021 deletions

View File

@@ -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