From 399bd4acff5f38807dae397ca9721b5622e43e64 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 6 Jan 2022 11:24:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=BC=95=E8=B5=B7=E7=9A=84=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=BC=8F=E6=B4=9E=E5=8F=8A=E7=94=A8=E4=BE=8B=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/sampler/MsHTTPSamplerProxy.java | 14 +++++--------- .../io/metersphere/commons/utils/ShiroUtils.java | 3 --- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java index 9f3492ed91..45a093ce98 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java @@ -410,13 +410,11 @@ public class MsHTTPSamplerProxy extends MsTestElement { this.useEnvironment = config.getConfig().get(this.getProjectId()).getApiEnvironmentid(); } String url = httpConfig.getProtocol() + "://" + httpConfig.getSocket(); - // 补充如果是完整URL 则用自身URL - - if (StringUtils.isNotEmpty(this.getUrl()) && ElementUtil.isURL(this.getUrl())) { - url = this.getUrl(); - } - if (isUrl()) { + // 补充如果是完整URL 则用自身URL + if (StringUtils.isNotEmpty(this.getUrl()) && ElementUtil.isURL(this.getUrl())) { + url = this.getUrl(); + } if (this.isCustomizeReq()) { url = this.getUrl(); sampler.setProperty("HTTPSampler.path", url); @@ -633,9 +631,6 @@ public class MsHTTPSamplerProxy extends MsTestElement { } return true; } - if (StringUtils.isNotEmpty(this.getUrl()) && ElementUtil.isURL(this.getUrl())) { - return true; - } return false; } @@ -811,6 +806,7 @@ public class MsHTTPSamplerProxy extends MsTestElement { } else { TestPlanApiCaseService testPlanApiCaseService = CommonBeanFactory.getBean(TestPlanApiCaseService.class); TestPlanApiCase testPlanApiCase = testPlanApiCaseService.getById(this.getId()); + testPlanApiCase = testPlanApiCase == null ? testPlanApiCaseService.getById(this.getName()) : testPlanApiCase; if (testPlanApiCase != null) { ApiTestCaseWithBLOBs caseWithBLOBs = apiTestCaseService.get(testPlanApiCase.getApiCaseId()); if (caseWithBLOBs != null) { diff --git a/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java b/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java index bc5a07ee4e..b45c7c9525 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java +++ b/backend/src/main/java/io/metersphere/commons/utils/ShiroUtils.java @@ -69,9 +69,6 @@ public class ShiroUtils { //mock接口 filterChainDefinitionMap.put("/mock/**", "anon"); filterChainDefinitionMap.put("/ws/**", "anon"); - - filterChainDefinitionMap.put("/plugin/**", "anon"); - } public static void ignoreCsrfFilter(Map filterChainDefinitionMap) {