Merge pull request #18741 from WeiZhang555/debug-info

Better debug message for post form data
This commit is contained in:
Antonio Murdaca 2015-12-18 16:06:07 +01:00
commit 47060efdb7
1 changed files with 6 additions and 1 deletions

View File

@ -38,7 +38,12 @@ func debugRequestMiddleware(handler httputils.APIFunc) httputils.APIFunc {
if _, exists := postForm["password"]; exists {
postForm["password"] = "*****"
}
logrus.Debugf("form data: %q", postForm)
formStr, errMarshal := json.Marshal(postForm)
if errMarshal == nil {
logrus.Debugf("form data: %s", string(formStr))
} else {
logrus.Debugf("form data: %q", postForm)
}
}
}
}