소스 검색

错误请求限制

沈静伟 4 년 전
부모
커밋
0351ee772b
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/dsb/com/cnd3b/common/restful/WebClientRest.java

+ 3 - 0
src/dsb/com/cnd3b/common/restful/WebClientRest.java

@@ -48,6 +48,9 @@ public class WebClientRest {
 
     @POST
     public String method(@Context HttpServletRequest request, String RequestContent) {
+        if (RequestContent == null || RequestContent.equals("")) {
+            return new D3BReturnObject_Err().setErrMsg("请求正文格式错误,必须为JSONObject格式").toString();
+        }
         /**
          * 验证请求正文是否为规范的SONObject格式
          */