fix(接口测试): 增加domain 为 undefined时校验

This commit is contained in:
fit2-zhao 2020-09-30 16:19:50 +08:00
parent 9c1150d5f5
commit f32b6b530b
1 changed files with 6 additions and 4 deletions

View File

@ -1140,11 +1140,13 @@ class JMXGenerator {
let domain = request.environment.config.httpConfig.domain;
let validHosts = [];
hosts.forEach(item => {
if (item.domain != undefined && domain != undefined) {
let d = item.domain.trim().replace("http://", "").replace("https://", "");
if (item && d === domain.trim()) {
if (d === domain.trim()) {
item.domain = d; // 域名去掉协议
validHosts.push(item);
}
}
});
if (validHosts.length > 0) {
threadGroup.put(new DNSCacheManager(name, validHosts));