Commit 399bd4ac authored by song-tianyang's avatar song-tianyang Committed by song-tianyang
Browse files

fix(测试跟踪): 修复自定义插件功能引起的安全漏洞及用例模块匹配问题

parent 0ceee143
Showing with 5 additions and 12 deletions
+5 -12
...@@ -410,13 +410,11 @@ public class MsHTTPSamplerProxy extends MsTestElement { ...@@ -410,13 +410,11 @@ public class MsHTTPSamplerProxy extends MsTestElement {
this.useEnvironment = config.getConfig().get(this.getProjectId()).getApiEnvironmentid(); this.useEnvironment = config.getConfig().get(this.getProjectId()).getApiEnvironmentid();
} }
String url = httpConfig.getProtocol() + "://" + httpConfig.getSocket(); String url = httpConfig.getProtocol() + "://" + httpConfig.getSocket();
// 补充如果是完整URL 则用自身URL
if (StringUtils.isNotEmpty(this.getUrl()) && ElementUtil.isURL(this.getUrl())) {
url = this.getUrl();
}
if (isUrl()) { if (isUrl()) {
// 补充如果是完整URL 则用自身URL
if (StringUtils.isNotEmpty(this.getUrl()) && ElementUtil.isURL(this.getUrl())) {
url = this.getUrl();
}
if (this.isCustomizeReq()) { if (this.isCustomizeReq()) {
url = this.getUrl(); url = this.getUrl();
sampler.setProperty("HTTPSampler.path", url); sampler.setProperty("HTTPSampler.path", url);
...@@ -633,9 +631,6 @@ public class MsHTTPSamplerProxy extends MsTestElement { ...@@ -633,9 +631,6 @@ public class MsHTTPSamplerProxy extends MsTestElement {
} }
return true; return true;
} }
if (StringUtils.isNotEmpty(this.getUrl()) && ElementUtil.isURL(this.getUrl())) {
return true;
}
return false; return false;
} }
...@@ -811,6 +806,7 @@ public class MsHTTPSamplerProxy extends MsTestElement { ...@@ -811,6 +806,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
} else { } else {
TestPlanApiCaseService testPlanApiCaseService = CommonBeanFactory.getBean(TestPlanApiCaseService.class); TestPlanApiCaseService testPlanApiCaseService = CommonBeanFactory.getBean(TestPlanApiCaseService.class);
TestPlanApiCase testPlanApiCase = testPlanApiCaseService.getById(this.getId()); TestPlanApiCase testPlanApiCase = testPlanApiCaseService.getById(this.getId());
testPlanApiCase = testPlanApiCase == null ? testPlanApiCaseService.getById(this.getName()) : testPlanApiCase;
if (testPlanApiCase != null) { if (testPlanApiCase != null) {
ApiTestCaseWithBLOBs caseWithBLOBs = apiTestCaseService.get(testPlanApiCase.getApiCaseId()); ApiTestCaseWithBLOBs caseWithBLOBs = apiTestCaseService.get(testPlanApiCase.getApiCaseId());
if (caseWithBLOBs != null) { if (caseWithBLOBs != null) {
......
...@@ -69,9 +69,6 @@ public class ShiroUtils { ...@@ -69,9 +69,6 @@ public class ShiroUtils {
//mock接口 //mock接口
filterChainDefinitionMap.put("/mock/**", "anon"); filterChainDefinitionMap.put("/mock/**", "anon");
filterChainDefinitionMap.put("/ws/**", "anon"); filterChainDefinitionMap.put("/ws/**", "anon");
filterChainDefinitionMap.put("/plugin/**", "anon");
} }
public static void ignoreCsrfFilter(Map<String, String> filterChainDefinitionMap) { public static void ignoreCsrfFilter(Map<String, String> filterChainDefinitionMap) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment