Skip to content

Commit

Permalink
ignore empty bodies in web logger
Browse files Browse the repository at this point in the history
  • Loading branch information
dimroc committed May 20, 2019
1 parent fce8d76 commit 9fb34a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/web/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ func readBody(reader io.Reader) string {
return "*FAILED TO READ BODY*"
}

if buf.Len() == 0 {
return ""
}

s, err := readSanitizedJSON(buf)
if err != nil {
logger.Warn("unable to sanitize json for logging: ", err)
Expand Down

0 comments on commit 9fb34a9

Please sign in to comment.