From 58f7ce3159f7ec2588ffc794720c2232fb2adbf8 Mon Sep 17 00:00:00 2001 From: chenwendong 01013 Date: Tue, 11 Apr 2023 10:53:20 +0800 Subject: [PATCH 1/2] optimize schedulis returns empty ResponseBody (ResponseBody is null ) --- .../dss/appconn/schedulis/utils/SchedulisHttpUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/utils/SchedulisHttpUtils.java b/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/utils/SchedulisHttpUtils.java index 12cc31e7e2..2fc8b56c89 100644 --- a/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/utils/SchedulisHttpUtils.java +++ b/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/utils/SchedulisHttpUtils.java @@ -52,7 +52,8 @@ public static String getHttpResult(String url, SSOUrlBuilderOperation ssoUrlBuilderOperation = getSSORequestOperation(url, workspace); action.setUrl(ssoUrlBuilderOperation.getBuiltUrl()); HttpResult previewResult = ssoRequestOperation.requestWithSSO(ssoUrlBuilderOperation, action); - if (previewResult.getStatusCode() == 200 || previewResult.getStatusCode() == 0) { + if (StringUtils.isNotBlank(previewResult.getResponseBody()) + && (previewResult.getStatusCode() == 200 || previewResult.getStatusCode() == 0) ) { return previewResult.getResponseBody(); } else { logger.error("request Schedulis failed, responseBody is {}.", previewResult.getResponseBody()); From da20e3508e7af37438f723719532dfafff1ee0ce Mon Sep 17 00:00:00 2001 From: chenwendong 01013 Date: Tue, 11 Apr 2023 11:04:32 +0800 Subject: [PATCH 2/2] optimize schedulis returns empty ResponseBody (ResponseBody is null ) --- .../dss/appconn/schedulis/utils/SchedulisHttpUtils.java | 1 + 1 file changed, 1 insertion(+) diff --git a/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/utils/SchedulisHttpUtils.java b/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/utils/SchedulisHttpUtils.java index 2fc8b56c89..5f3aaa31f8 100644 --- a/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/utils/SchedulisHttpUtils.java +++ b/dss-appconn/appconns/dss-schedulis-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/schedulis/utils/SchedulisHttpUtils.java @@ -24,6 +24,7 @@ import com.webank.wedatasphere.dss.standard.app.sso.request.SSORequestOperation; import com.webank.wedatasphere.dss.standard.common.exception.operation.ExternalOperationFailedException; import com.webank.wedatasphere.dss.standard.sso.utils.SSOHelper; +import org.apache.commons.lang.StringUtils; import org.apache.linkis.httpclient.request.HttpAction; import org.apache.linkis.httpclient.response.HttpResult; import org.slf4j.Logger;