diff options
Diffstat (limited to 'DomainDig')
| -rw-r--r-- | DomainDig/DNSLookupService.swift | 6 | ||||
| -rw-r--r-- | DomainDig/DomainViewModel.swift | 2 | ||||
| -rw-r--r-- | DomainDig/Models.swift | 28 |
3 files changed, 27 insertions, 9 deletions
diff --git a/DomainDig/DNSLookupService.swift b/DomainDig/DNSLookupService.swift index 8c8d53c..00ca13b 100644 --- a/DomainDig/DNSLookupService.swift +++ b/DomainDig/DNSLookupService.swift @@ -87,7 +87,7 @@ struct DNSLookupService { } else { value = answer.data.trimmingCharacters(in: CharacterSet(charactersIn: "\"")) } - return DNSRecord(value: value, ttl: answer.TTL) + return DNSRecord(value: value, ttl: answer.ttl) } } @@ -202,8 +202,8 @@ struct DNSLookupService { let dnsResponse = try JSONDecoder().decode(CloudflareDNSResponse.self, from: data) return DNSLookupResponse( - answers: dnsResponse.Answer ?? [], - authenticatedData: dnsResponse.AD ?? false + answers: dnsResponse.answer ?? [], + authenticatedData: dnsResponse.authenticatedData ?? false ) } diff --git a/DomainDig/DomainViewModel.swift b/DomainDig/DomainViewModel.swift index 7246112..c6ebf4f 100644 --- a/DomainDig/DomainViewModel.swift +++ b/DomainDig/DomainViewModel.swift @@ -3564,7 +3564,7 @@ final class DomainViewModel { if let org = ipGeolocation.org { rows.append(InfoRowViewData(label: "Org / ISP", value: org, tone: .secondary)) } - let location = [ipGeolocation.city, ipGeolocation.region, ipGeolocation.country_name].compactMap { $0 }.joined(separator: ", ") + let location = [ipGeolocation.city, ipGeolocation.region, ipGeolocation.countryName].compactMap { $0 }.joined(separator: ", ") if !location.isEmpty { rows.append(InfoRowViewData(label: "Location", value: location, tone: .secondary)) } diff --git a/DomainDig/Models.swift b/DomainDig/Models.swift index d83dc79..e93fb46 100644 --- a/DomainDig/Models.swift +++ b/DomainDig/Models.swift @@ -2144,10 +2144,16 @@ struct IPGeolocation: Codable { let ip: String let city: String? let region: String? - let country_name: String? + let countryName: String? let org: String? let latitude: Double? let longitude: Double? + + enum CodingKeys: String, CodingKey { + case ip, city, region + case countryName = "country_name" + case org, latitude, longitude + } } // MARK: - Ownership Models @@ -2616,14 +2622,26 @@ struct HistoryEntry: Identifiable, Codable { // MARK: - Cloudflare DNS-over-HTTPS Response struct CloudflareDNSResponse: Decodable { - let Status: Int - let AD: Bool? - let Answer: [CloudflareDNSAnswer]? + let status: Int + let authenticatedData: Bool? + let answer: [CloudflareDNSAnswer]? + + enum CodingKeys: String, CodingKey { + case status = "Status" + case authenticatedData = "AD" + case answer = "Answer" + } struct CloudflareDNSAnswer: Decodable { let name: String let type: Int - let TTL: Int + let ttl: Int let data: String + + enum CodingKeys: String, CodingKey { + case name, type + case ttl = "TTL" + case data + } } } |
