Skip to content

Commit 0d5a784

Browse files
committed
Removed the trailing dot check.
1 parent 84661ed commit 0d5a784

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

TechnitiumLibrary.Net/Dns/ResourceRecords/DnsNAPTRRecordData.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public DnsNAPTRRecordData(ushort order, ushort preference, string flags, string
6666
for (int i = 0; i < flags.Length; i++)
6767
{
6868
char c = flags[i];
69-
if (!(char.IsAsciiLetter(c) || char.IsDigit(c)))
69+
if (!(char.IsAsciiLetter(c) || char.IsAsciiDigit(c)))
7070
throw new ArgumentException(
7171
$"Invalid NAPTR flag '{c}'. Allowed set is A–Z and 0–9.",
7272
nameof(flags));
@@ -87,10 +87,8 @@ public DnsNAPTRRecordData(ushort order, ushort preference, string flags, string
8787
if (replacement.Length > 0)
8888
{
8989
// Must end with a root label (trailing dot)
90-
if (!replacement.EndsWith(".", StringComparison.Ordinal))
91-
throw new ArgumentException(
92-
"REPLACEMENT must be a fully qualified domain name ending with a dot.",
93-
nameof(replacement));
90+
// But zoneFile.PopDomainAsync() removes the trailing dot.
91+
// Therefore the check is useless.
9492

9593
// No name compression, no empty labels except the root
9694
if (replacement.Contains("..", StringComparison.Ordinal))

0 commit comments

Comments
 (0)