diff --git a/DnsServerCore/WebServiceDhcpApi.cs b/DnsServerCore/WebServiceDhcpApi.cs index 0759fc10..d2ea6662 100644 --- a/DnsServerCore/WebServiceDhcpApi.cs +++ b/DnsServerCore/WebServiceDhcpApi.cs @@ -1,6 +1,6 @@ /* Technitium DNS Server -Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com) +Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,6 +34,8 @@ namespace DnsServerCore { #region variables + static readonly char[] _commaSeparator = new char[] { ',' }; + readonly DnsWebService _dnsWebService; #endregion @@ -450,7 +452,7 @@ namespace DnsServerCore if (domainSearchList.Length == 0) scope.DomainSearchList = null; else - scope.DomainSearchList = domainSearchList.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + scope.DomainSearchList = domainSearchList.Split(_commaSeparator, StringSplitOptions.RemoveEmptyEntries); } if (request.TryGetQueryOrForm("dnsUpdates", bool.Parse, out bool dnsUpdates)) @@ -514,7 +516,7 @@ namespace DnsServerCore if (ntpServerDomainNames.Length == 0) scope.NtpServerDomainNames = null; else - scope.NtpServerDomainNames = ntpServerDomainNames.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + scope.NtpServerDomainNames = ntpServerDomainNames.Split(_commaSeparator, StringSplitOptions.RemoveEmptyEntries); } string strStaticRoutes = request.QueryOrForm("staticRoutes");