@@ -77,8 +77,8 @@ public static Result signUp(){
77
77
Http .RequestBody body = request ().body ();
78
78
79
79
JsonNode bodyJson = body .asJson ();
80
- Logger .debug ("signUp bodyJson: " + bodyJson );
81
-
80
+ Logger .trace ("signUp bodyJson: " + bodyJson );
81
+ if ( bodyJson == null ) return badRequest ( "The body payload cannot be empty. Hint: put in the request header Content-Type: application/json" );
82
82
//check and validate input
83
83
if (!bodyJson .has ("username" ))
84
84
return badRequest ("The 'username' field is missing" );
@@ -113,7 +113,8 @@ public static Result updateProfile(){
113
113
Http .RequestBody body = request ().body ();
114
114
115
115
JsonNode bodyJson = body .asJson ();
116
- Logger .debug ("updateProfile bodyJson: " + bodyJson );
116
+ Logger .trace ("updateProfile bodyJson: " + bodyJson );
117
+ if (bodyJson ==null ) return badRequest ("The body payload cannot be empty. Hint: put in the request header Content-Type: application/json" );
117
118
118
119
//extract the profile fields
119
120
JsonNode nonAppUserAttributes = bodyJson .get (UserDao .ATTRIBUTES_VISIBLE_BY_ANONYMOUS_USER );
@@ -162,7 +163,8 @@ public static Result changePassword(){
162
163
Http .RequestBody body = request ().body ();
163
164
164
165
JsonNode bodyJson = body .asJson ();
165
- Logger .debug ("changePassword bodyJson: " + bodyJson );
166
+ Logger .trace ("changePassword bodyJson: " + bodyJson );
167
+ if (bodyJson ==null ) return badRequest ("The body payload cannot be empty. Hint: put in the request header Content-Type: application/json" );
166
168
167
169
//check and validate input
168
170
if (!bodyJson .has ("old" ))
0 commit comments