diff --git a/api/server/middleware.go b/api/server/middleware.go index 548d0c2911..91f72f1157 100644 --- a/api/server/middleware.go +++ b/api/server/middleware.go @@ -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) + } } } }