Handle ioutil deprecations (#53526)
* replace ioutil.ReadFile -> os.ReadFile * replace ioutil.ReadAll -> io.ReadAll * replace ioutil.TempFile -> os.CreateTemp * replace ioutil.NopCloser -> io.NopCloser * replace ioutil.WriteFile -> os.WriteFile * replace ioutil.TempDir -> os.MkdirTemp * replace ioutil.Discard -> io.Discard
This commit is contained in:
@@ -3,7 +3,7 @@ package pluginproxy
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
@@ -107,9 +107,9 @@ func logAppPluginProxyRequest(appID string, cfg *setting.Cfg, c *models.ReqConte
|
||||
|
||||
var body string
|
||||
if c.Req.Body != nil {
|
||||
buffer, err := ioutil.ReadAll(c.Req.Body)
|
||||
buffer, err := io.ReadAll(c.Req.Body)
|
||||
if err == nil {
|
||||
c.Req.Body = ioutil.NopCloser(bytes.NewBuffer(buffer))
|
||||
c.Req.Body = io.NopCloser(bytes.NewBuffer(buffer))
|
||||
body = string(buffer)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user