fix: merge bonjour txt records for ssh autofill

This commit is contained in:
Peter Steinberger committed 2025-12-20 19:27:36 +01:00
1 parent 943f0d475f
commit 35e0894655
1 file changed
+11 -2
@@ -179,8 +179,17 @@ final class GatewayDiscoveryModel {
}
private static func txtDictionary(from result: NWBrowser.Result) -> [String: String] {
guard case let .bonjour(txt) = result.metadata else { return [:] }
return txt.dictionary
var merged: [String: String] = [:]
if case let .bonjour(txt) = result.metadata {
merged.merge(txt.dictionary, uniquingKeysWith: { _, new in new })
}
if let endpointTxt = result.endpoint.txtRecord?.dictionary {
merged.merge(endpointTxt, uniquingKeysWith: { _, new in new })
}
return merged
}
private static func prettifyInstanceName(_ decodedName: String) -> String {