Commit d4a96b97 by bergquist

tech(dataproxy): make the code a little bit more defensive

parent dd84fb56
......@@ -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)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment