Commit 5f3b2a9c authored by fit2-zhao's avatar fit2-zhao Committed by fit2-zhao
Browse files

fix(接口测试): 修复接口执行模块匹配多出端口问题

--bug=1010400 --user=赵勇 【接口测试】环境模块匹配,匹配不到域名的接口,调试的时候多了个端口号 https://www.tapd.cn/55049933/s/1105831
parent 7d77f5a0
Showing with 2 additions and 1 deletion
+2 -1
...@@ -421,14 +421,15 @@ public class MsHTTPSamplerProxy extends MsTestElement { ...@@ -421,14 +421,15 @@ public class MsHTTPSamplerProxy extends MsTestElement {
if (StringUtils.isNotBlank(this.getPath())) { if (StringUtils.isNotBlank(this.getPath())) {
envPath += this.getPath(); envPath += this.getPath();
} }
sampler.setPort(httpConfig.getPort());
if (StringUtils.isNotEmpty(httpConfig.getDomain())) { if (StringUtils.isNotEmpty(httpConfig.getDomain())) {
sampler.setDomain(URLDecoder.decode(httpConfig.getDomain(), "UTF-8")); sampler.setDomain(URLDecoder.decode(httpConfig.getDomain(), "UTF-8"));
sampler.setProtocol(httpConfig.getProtocol()); sampler.setProtocol(httpConfig.getProtocol());
} else { } else {
sampler.setDomain(""); sampler.setDomain("");
sampler.setProtocol(""); sampler.setProtocol("");
sampler.setPort(-1);
} }
sampler.setPort(httpConfig.getPort());
} else { } else {
URL urlObject = new URL(this.path); URL urlObject = new URL(this.path);
envPath = StringUtils.equals(urlObject.getPath(), "/") ? "" : urlObject.getFile(); envPath = StringUtils.equals(urlObject.getPath(), "/") ? "" : urlObject.getFile();
......
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