From 345bd0fc47bb4514393ebfce02ebc6dfcad4e7fb Mon Sep 17 00:00:00 2001 From: git Date: Mon, 16 Jun 2025 16:20:52 +0100 Subject: [PATCH] fixed bug --- main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 32da88a..b01ace4 100644 --- a/main.js +++ b/main.js @@ -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')) }); } }