mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
add checking null and blank values in the putCredentials method.
This commit is contained in:
parent
03717018b8
commit
9b2c1c98db
1 changed files with 3 additions and 1 deletions
4
zeppelin-server/src/main/java/org/apache/zeppelin/rest/CredentialRestApi.java
Normal file → Executable file
4
zeppelin-server/src/main/java/org/apache/zeppelin/rest/CredentialRestApi.java
Normal file → Executable file
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package org.apache.zeppelin.rest;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import org.apache.zeppelin.user.Credentials;
|
||||
|
|
@ -70,7 +71,8 @@ public class CredentialRestApi {
|
|||
String username = messageMap.get("username");
|
||||
String password = messageMap.get("password");
|
||||
|
||||
if (entity == null || username == null || password == null) {
|
||||
if (Strings.isNullOrEmpty(entity)
|
||||
|| Strings.isNullOrEmpty(username) || Strings.isNullOrEmpty(password) ) {
|
||||
return new JsonResponse(Status.BAD_REQUEST).build();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue