fix(接口测试): 使用mock环境,url拼接错误
--bug=1045933 --user=陈建星 [接口测试】接口场景中使用MOCK环境执行,请求URL 地址错误 https://www.tapd.cn/55049933/s/1578907
This commit is contained in:
parent
cd26045961
commit
36242372f1
|
@ -187,7 +187,14 @@ public class MsHTTPElementConverter extends AbstractJmeterElementConverter<MsHTT
|
|||
if (httpConfig != null) {
|
||||
// 接口调试没有环境,不取环境的配置
|
||||
String protocol = httpConfig.getProtocol().toLowerCase();
|
||||
url = protocol + "://" + (httpConfig.getHostname() + "/" + url).replace("//", "/");
|
||||
String hostName = httpConfig.getHostname();
|
||||
if (hostName.lastIndexOf("/") == hostName.length() - 1) {
|
||||
hostName = hostName.substring(0, hostName.length() - 1);
|
||||
}
|
||||
if (url.indexOf("/") == 0) {
|
||||
url = url.substring(1);
|
||||
}
|
||||
url = protocol + "://" + (hostName + "/" + url);
|
||||
}
|
||||
url = getPathWithQueryRest(msHTTPElement, url);
|
||||
return getPathWithQuery(url, msHTTPElement.getQuery());
|
||||
|
|
Loading…
Reference in New Issue