fix(classes.dnsclient): Remove redundant DOH response parsing in getRecords to avoid duplicate processing and clean up client code

This commit is contained in:
2025-09-12 17:38:43 +00:00
parent 1b9eefd70f
commit 911a20c86d
3 changed files with 9 additions and 18 deletions

View File

@@ -252,23 +252,7 @@ export class Smartdns {
return [];
}
}
for (const dnsEntry of responseBody.Answer) {
if (dnsEntry.data.startsWith('"') && dnsEntry.data.endsWith('"')) {
dnsEntry.data = dnsEntry.data.replace(/^"(.*)"$/, '$1');
}
if (dnsEntry.name.endsWith('.')) {
dnsEntry.name = dnsEntry.name.substring(0, dnsEntry.name.length - 1);
}
returnArray.push({
name: dnsEntry.name,
type: this.convertDnsTypeNumberToTypeName(dnsEntry.type),
dnsSecEnabled: responseBody.AD,
value: dnsEntry.data,
});
}
// console.log(responseBody);
return returnArray;
}
/**
* gets a record using nodejs dns resolver