Skip to content

Commit

Permalink
Merge pull request #1240 from smartcontractkit/chores/empty-body-shou…
Browse files Browse the repository at this point in the history
…ldnt-spam-logs

ignore empty bodies in web logger
  • Loading branch information
dimroc authored May 20, 2019
2 parents 7f3a768 + 9fb34a9 commit 8f0dcbb
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 8f0dcbb

Please sign in to comment.