From c924ec6188b718d158d58b667cab4081d8c4b0ce Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sun, 23 Apr 2023 16:29:01 +0530 Subject: [PATCH] WebServiceDashboardApi: added IDN support. --- DnsServerCore/WebServiceDashboardApi.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/DnsServerCore/WebServiceDashboardApi.cs b/DnsServerCore/WebServiceDashboardApi.cs index 4c9c22ee..af8335b0 100644 --- a/DnsServerCore/WebServiceDashboardApi.cs +++ b/DnsServerCore/WebServiceDashboardApi.cs @@ -461,6 +461,10 @@ namespace DnsServerCore jsonWriter.WriteStartObject(); jsonWriter.WriteString("name", item.Key); + + if (item.Key.Contains("xn--", StringComparison.OrdinalIgnoreCase)) + jsonWriter.WriteString("nameIdn", DnsClient.ConvertDomainNameToUnicode(item.Key)); + jsonWriter.WriteNumber("hits", item.Value); jsonWriter.WriteEndObject(); @@ -481,6 +485,10 @@ namespace DnsServerCore jsonWriter.WriteStartObject(); jsonWriter.WriteString("name", item.Key); + + if (item.Key.Contains("xn--", StringComparison.OrdinalIgnoreCase)) + jsonWriter.WriteString("nameIdn", DnsClient.ConvertDomainNameToUnicode(item.Key)); + jsonWriter.WriteNumber("hits", item.Value); jsonWriter.WriteEndObject(); @@ -588,6 +596,10 @@ namespace DnsServerCore jsonWriter.WriteStartObject(); jsonWriter.WriteString("name", item.Key); + + if (item.Key.Contains("xn--", StringComparison.OrdinalIgnoreCase)) + jsonWriter.WriteString("nameIdn", DnsClient.ConvertDomainNameToUnicode(item.Key)); + jsonWriter.WriteNumber("hits", item.Value); jsonWriter.WriteEndObject(); @@ -607,6 +619,10 @@ namespace DnsServerCore jsonWriter.WriteStartObject(); jsonWriter.WriteString("name", item.Key); + + if (item.Key.Contains("xn--", StringComparison.OrdinalIgnoreCase)) + jsonWriter.WriteString("nameIdn", DnsClient.ConvertDomainNameToUnicode(item.Key)); + jsonWriter.WriteNumber("hits", item.Value); jsonWriter.WriteEndObject();