ReviewOS

also looking at this

stacks/ts-dns

fix: allow underscores in domain labels

#2057
Open lu-zero wants to merge fix/allow-underscores-in-domain-labels into main
2 files +19 -2
src/client.tsmodified+2-2
Changes to src/client.ts
@@ -41,7 +41,7 @@ export class DnsClient {
4141 * - Start/end dots
4242 * - Overall length (max 253 characters)
4343 * - Label length (max 63 characters)
44 * - Valid characters (a-z, 0-9, -)
44 * - Valid characters (a-z, 0-9, -, _)
4545 *
4646 * @param domain - The domain name to validate
4747 * @throws {Error} If the domain name is invalid
@@ -70,7 +70,7 @@ export class DnsClient {
7070 }
7171
7272 // Check label characters
73 if (!/^[a-z0-9-]+$/i.test(label)) {
73 if (!/^[a-z0-9_-]+$/i.test(label)) {
7474 throw new Error(`Invalid characters in domain label: ${label}`)
7575 }
7676 }