fix(接口测试): 加强host列表校验
This commit is contained in:
parent
92c5215349
commit
a92db96844
|
@ -123,6 +123,9 @@
|
|||
validateDomain(domain) {
|
||||
let url = {};
|
||||
try {
|
||||
if (!domain.startsWith("http") || !domain.startsWith("https")) {
|
||||
domain += "http://";
|
||||
}
|
||||
url = new URL(domain);
|
||||
} catch (e) {
|
||||
this.$warning(this.$t('load_test.input_domain'));
|
||||
|
|
|
@ -504,8 +504,8 @@ export class DNSCacheManager extends DefaultTestElement {
|
|||
let collectionPropHosts = this.collectionProp('DNSCacheManager.hosts');
|
||||
|
||||
hosts.forEach(host => {
|
||||
let elementProp = collectionPropHosts.elementProp('', 'StaticHost');
|
||||
if (host && host.domain.trim() === domain.trim()) {
|
||||
let elementProp = collectionPropHosts.elementProp(host.domain, 'StaticHost');
|
||||
if (host && host.domain.trim().indexOf(domain.trim()) != -1) {
|
||||
elementProp.stringProp('StaticHost.Name', host.domain);
|
||||
elementProp.stringProp('StaticHost.Address', host.ip);
|
||||
}
|
||||
|
|
|
@ -948,8 +948,8 @@ class JMXGenerator {
|
|||
let name = request.name + " DNSCacheManager";
|
||||
let hosts = JSON.parse(request.environment.hosts);
|
||||
if (hosts.length > 0) {
|
||||
let domain = request.environment.protocol + "://" + request.environment.domain;
|
||||
threadGroup.put(new DNSCacheManager(name, domain, hosts));
|
||||
//let domain = request.environment.protocol + "://" + request.environment.domain;
|
||||
threadGroup.put(new DNSCacheManager(name, request.environment.domain, hosts));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue