fixed bug

This commit is contained in:
git 2025-06-16 16:20:52 +01:00
parent 80d493ef78
commit 345bd0fc47

View File

@ -174,7 +174,7 @@ function replyLocallyWithRemoteDevicesData(name,type,query) {
class: 'IN',
ttl: 120,
// Convert plain string to buffer; required by mdns-server
data: Buffer.from(db.remote.services[name].TXT, 'utf8')
data: r.TXT.map(entry=>Buffer.from(entry.data,'utf8'))
});
}
// 5. Many mDNS tools (like Avahi or Bonjour) send type: 'ANY' queries to discover all records for a name.
@ -191,7 +191,7 @@ function replyLocallyWithRemoteDevicesData(name,type,query) {
if (db.remote.services[name]) {
const r = db.remote.services[name];
if (r.SRV) answers.push({ name, type: 'SRV', class: 'IN', ttl: 120, data: r.SRV });
if (r.TXT) answers.push({ name, type: 'TXT', class: 'IN', ttl: 120, data: r.TXT.map(entry=>Buffer.from(entry.data)) });
if (r.TXT) answers.push({ name, type: 'TXT', class: 'IN', ttl: 120, data: r.TXT.map(entry=>Buffer.from(entry.data,'utf8')) });
}
}