fix:DELETE,HTTPS请求头自动添加的HOST带了443端口

This commit is contained in:
chenjianxing 2021-05-11 10:35:49 +08:00 committed by jianxing
parent 131e0577b5
commit d330bdd7ed
1 changed files with 4 additions and 0 deletions

View File

@ -264,6 +264,10 @@ public class MsHTTPSamplerProxy extends MsTestElement {
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);