mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-19 15:44:02 +02:00
feat(txtCondition): flat txt records before conditions check
This commit is contained in:
parent
cfb53c4a3f
commit
b52e190677
1 changed files with 7 additions and 1 deletions
|
@ -34,11 +34,17 @@ class DnsMonitorType extends MonitorType {
|
|||
switch (monitor.dns_resolve_type) {
|
||||
case "A":
|
||||
case "AAAA":
|
||||
case "TXT":
|
||||
case "PTR":
|
||||
dnsMessage = `Records: ${dnsRes.join(" | ")}`;
|
||||
conditionsResult = dnsRes.some(record => handleConditions({ record }));
|
||||
break;
|
||||
|
||||
case "TXT":
|
||||
dnsMessage = `Records: ${dnsRes.join(" | ")}`;
|
||||
// Node.js resolveTxt brings an array of array
|
||||
let txtRecords = dnsRes.flat();
|
||||
conditionsResult = txtRecords.some(record => handleConditions({ record }));
|
||||
break;
|
||||
|
||||
case "CNAME":
|
||||
dnsMessage = dnsRes[0];
|
||||
|
|
Loading…
Add table
Reference in a new issue