Skip to content

Commit e83f67b

Browse files
committed
fix: remove interfaces from discovered services
1 parent 3bd181d commit e83f67b

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

AllSpark-ios/ConnectionManager.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,16 @@ class ConnectionManager: NSObject, ObservableObject {
390390

391391
let hostString: String
392392
switch host {
393-
case .ipv4(let ip): hostString = "\(ip)"
394-
case .ipv6(let ip): hostString = "[\(ip)]"
395-
case .name(let name, _): hostString = name
396-
@unknown default: hostString = "unknown"
393+
case .ipv4(let ip):
394+
let cleanIP = "\(ip)".components(separatedBy: "%").first ?? "\(ip)"
395+
hostString = cleanIP
396+
case .ipv6(let ip):
397+
let cleanIP = "\(ip)".components(separatedBy: "%").first ?? "\(ip)"
398+
hostString = "[\(cleanIP)]"
399+
case .name(let name, _):
400+
hostString = name
401+
@unknown default:
402+
hostString = "unknown"
397403
}
398404

399405
let portString = "\(port.rawValue)"

0 commit comments

Comments
 (0)