From e3dab1392f314b4c1d38f4645e3107bb84189a4b Mon Sep 17 00:00:00 2001 From: Deluan Date: Thu, 10 Mar 2016 09:56:10 -0500 Subject: [PATCH] Log validation errors --- api/validation.go | 2 ++ api/validation_test.go | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/validation.go b/api/validation.go index d273c8ac..4aab3b48 100644 --- a/api/validation.go +++ b/api/validation.go @@ -27,6 +27,7 @@ func checkParameters(c ControllerInterface) { for _, p := range requiredParameters { if c.GetString(p) == "" { + beego.Warn("Missing required parameter:", p) abortRequest(c, responses.ERROR_MISSING_PARAMETER) } } @@ -42,6 +43,7 @@ func authenticate(c ControllerInterface) { } } if user != beego.AppConfig.String("user") || pass != beego.AppConfig.String("password") { + beego.Warn("Invalid login:", user) abortRequest(c, responses.ERROR_AUTHENTICATION_FAIL) } } diff --git a/api/validation_test.go b/api/validation_test.go index 3bb3e361..0bc204af 100644 --- a/api/validation_test.go +++ b/api/validation_test.go @@ -58,7 +58,6 @@ func TestAuthentication(t *testing.T) { _, w := Get("/rest/ping.view?u=deluan&p=enc:776f726470617373&c=test&v=1.0.0", "TestAuthentication") Convey("The status should be 'ok'", func() { v := responses.Subsonic{} - println("------", w.Body.String()) xml.Unmarshal(w.Body.Bytes(), &v) So(v.Status, ShouldEqual, "ok") })