mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tech(dataproxy): make the code a little bit more defensive
This commit is contained in:
parent
dd84fb563a
commit
d4a96b9741
@ -139,9 +139,10 @@ func logProxyRequest(dataSourceType string, c *middleware.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
var body string
|
||||
if c.Req.Request.Body != nil {
|
||||
buffer, _ := ioutil.ReadAll(c.Req.Request.Body)
|
||||
var body string
|
||||
if c.Req.Request.Body != nil {
|
||||
buffer, err := ioutil.ReadAll(c.Req.Request.Body)
|
||||
if err == nil {
|
||||
c.Req.Request.Body = ioutil.NopCloser(bytes.NewBuffer(buffer))
|
||||
body = string(buffer)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user