Skip to content

Commit e78c35b

Browse files
Fix DNS modal to allow one char domains (#393)
* update regex to allow one char domains in DNS routing modal * update regex
1 parent 6ebee98 commit e78c35b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const sleep = (ms: number) => {
4242
export const validator = {
4343
isValidDomain: (domain: string) => {
4444
const unicodeDomain =
45-
/^(?!.*\s)(\.?[a-zA-Z0-9\u00A1-\uFFFF](?!.*\s$)(?!.*\.$)(?:(?!-)[a-zA-Z0-9\u00A1-\uFFFF-]{1,63}(?<!-)\.){0,126}(?!-)[a-zA-Z0-9\u00A1-\uFFFF-]{1,63}(?<!-))$/u;
45+
/^(?!.*\.\.)(?!.*\.$)(?!.*\s)(?:(?!-)(?!.*--)[a-zA-Z0-9\u00A1-\uFFFF-]{1,63}(?<!-)\.)+(?!-)(?!.*--)[a-zA-Z0-9\u00A1-\uFFFF-]{2,63}$/u;
4646
try {
4747
const minMaxChars = [1, 255];
4848
const isValidDomainLength =

0 commit comments

Comments
 (0)