fix(接口测试): 修复环境域名是变量,变量值带https://,执行结果中请求地址错误的缺陷

--bug=1025602 --user=王孝刚 【项目设置】环境域名是变量,变量值带https://,执行结果中请求地址错误
https://www.tapd.cn/55049933/s/1364226
This commit is contained in:
wxg0103 2023-04-19 10:44:36 +08:00 committed by fit2-zhao
parent 7d3122f4cb
commit 53c8ee81f9
1 changed files with 2 additions and 3 deletions

View File

@ -429,13 +429,12 @@ public class MsHTTPSamplerProxy extends MsTestElement {
if (StringUtils.isNotBlank(this.getPath())) {
envPath += this.getPath();
}
sampler.setPort(httpConfig.getPort());
if (httpConfig.getDomain().startsWith("${")) {
sampler.setProtocol(httpConfig.getProtocol());
envPath = StringUtils.isNotBlank(this.path) ? StringUtils.join(httpConfig.getSocket(), this.path) : url;
envPath = StringUtils.isNotBlank(this.path) ? StringUtils.join(url, this.path) : url;
} else if (StringUtils.isNotEmpty(httpConfig.getDomain())) {
sampler.setDomain(URLDecoder.decode(httpConfig.getDomain(), StandardCharsets.UTF_8.name()));
sampler.setProtocol(httpConfig.getProtocol());
sampler.setPort(httpConfig.getPort());
} else {
sampler.setDomain("");
sampler.setProtocol("");