fix(接口定义): 修复导入JMX的场景DELETE请求处理问题
--bug=1016235 --user=王孝刚 【接口测试】导入JMX的场景,DELETE请求处理问题 https://www.tapd.cn/55049933/s/1232429
This commit is contained in:
parent
564840def2
commit
e06e93d484
|
@ -49,6 +49,7 @@ import org.apache.jmeter.save.SaveService;
|
|||
import org.apache.jmeter.testelement.TestElement;
|
||||
import org.apache.jorphan.collections.HashTree;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
|
@ -405,7 +406,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
|||
|
||||
if (urlObject.getPort() > 0 && urlObject.getPort() == 10990 && StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) {
|
||||
sampler.setProperty("HTTPSampler.port", this.getPort());
|
||||
} else {
|
||||
} else if (urlObject.getPort() != -1) {
|
||||
sampler.setPort(urlObject.getPort());
|
||||
}
|
||||
sampler.setProtocol(urlObject.getProtocol());
|
||||
|
@ -457,12 +458,6 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
|||
if (!path.startsWith("/")) {
|
||||
path = "/" + path;
|
||||
}
|
||||
String port = sampler.getPort() != 80 ? ":" + sampler.getPort() : "";
|
||||
if (StringUtils.equals("https", sampler.getProtocol()) && sampler.getPort() == 443) {
|
||||
// 解决https delete请求时,path路径带443端口,请求头的host会变成域名加443
|
||||
port = "";
|
||||
}
|
||||
path = sampler.getProtocol() + "://" + sampler.getDomain() + port + path;
|
||||
}
|
||||
sampler.setProperty("HTTPSampler.path", path);
|
||||
}
|
||||
|
@ -481,7 +476,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
|||
sampler.setDomain(URLDecoder.decode(urlObject.getHost(), "UTF-8"));
|
||||
if (urlObject.getPort() > 0 && urlObject.getPort() == 10990 && StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) {
|
||||
sampler.setProperty("HTTPSampler.port", this.getPort());
|
||||
} else {
|
||||
} else if (urlObject.getPort() != -1) {
|
||||
sampler.setPort(urlObject.getPort());
|
||||
}
|
||||
sampler.setProtocol(urlObject.getProtocol());
|
||||
|
|
Loading…
Reference in New Issue