fix(接口测试): 修复DELETE请求接口使用变量作为域名的场景URL拼接错误问题
--bug=1012987 --user=赵勇 [接口测试]github#13239DELETE方法接口使用变量作为域名的场景URL拼接错误 https://www.tapd.cn/55049933/s/1152822
This commit is contained in:
parent
d8bc177b21
commit
ced328afce
|
@ -422,6 +422,8 @@ public class ElementUtil {
|
||||||
httpSamplerProxy.toHashTree(tmpHashTree, null, msParameter);
|
httpSamplerProxy.toHashTree(tmpHashTree, null, msParameter);
|
||||||
if (tmpHashTree != null && tmpHashTree.getArray().length > 0) {
|
if (tmpHashTree != null && tmpHashTree.getArray().length > 0) {
|
||||||
HTTPSamplerProxy object = (HTTPSamplerProxy) tmpHashTree.getArray()[0];
|
HTTPSamplerProxy object = (HTTPSamplerProxy) tmpHashTree.getArray()[0];
|
||||||
|
// 清空Domain
|
||||||
|
element.fluentPut("domain", "");
|
||||||
if (object != null && StringUtils.isNotEmpty(object.getDomain())) {
|
if (object != null && StringUtils.isNotEmpty(object.getDomain())) {
|
||||||
element.fluentPut("domain", StringUtils.isNotEmpty(object.getProtocol()) ? object.getProtocol() + "://" + object.getDomain() : object.getDomain());
|
element.fluentPut("domain", StringUtils.isNotEmpty(object.getProtocol()) ? object.getProtocol() + "://" + object.getDomain() : object.getDomain());
|
||||||
}
|
}
|
||||||
|
|
|
@ -453,7 +453,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(this.getArguments())) {
|
if (CollectionUtils.isNotEmpty(this.getArguments())) {
|
||||||
String path = postQueryParameters(envPath);
|
String path = postQueryParameters(envPath);
|
||||||
if (HTTPConstants.DELETE.equals(this.getMethod()) && !path.startsWith("${")) {
|
if (HTTPConstants.DELETE.equals(this.getMethod()) && !path.startsWith("${") && !path.startsWith("/${")) {
|
||||||
if (!path.startsWith("/")) {
|
if (!path.startsWith("/")) {
|
||||||
path = "/" + path;
|
path = "/" + path;
|
||||||
}
|
}
|
||||||
|
|
|
@ -748,6 +748,8 @@ export default {
|
||||||
if (item && map.has(item.resourceId)) {
|
if (item && map.has(item.resourceId)) {
|
||||||
item.domain = map.get(item.resourceId);
|
item.domain = map.get(item.resourceId);
|
||||||
item.resourceId = getUUID();
|
item.resourceId = getUUID();
|
||||||
|
}else{
|
||||||
|
item.domain = "";
|
||||||
}
|
}
|
||||||
if (item && item.hashTree && item.hashTree.length > 0) {
|
if (item && item.hashTree && item.hashTree.length > 0) {
|
||||||
this.margeDomain(item.hashTree, map);
|
this.margeDomain(item.hashTree, map);
|
||||||
|
@ -1269,6 +1271,7 @@ export default {
|
||||||
request.versionEnable = item.versionEnable;
|
request.versionEnable = item.versionEnable;
|
||||||
request.versionId = item.versionId;
|
request.versionId = item.versionId;
|
||||||
request.versionName = item.versionName;
|
request.versionName = item.versionName;
|
||||||
|
request.domain = "";
|
||||||
request.requestResult = [];
|
request.requestResult = [];
|
||||||
if (!request.url) {
|
if (!request.url) {
|
||||||
request.url = "";
|
request.url = "";
|
||||||
|
|
Loading…
Reference in New Issue