瀏覽代碼

错误请求限制

沈静伟 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格式
          */