mirror of
https://github.com/netbirdio/dashboard.git
synced 2026-01-26 01:21:04 +00:00
Fix DNS modal to allow one char domains (#393)
* update regex to allow one char domains in DNS routing modal * update regex
This commit is contained in:
@@ -42,7 +42,7 @@ export const sleep = (ms: number) => {
|
||||
export const validator = {
|
||||
isValidDomain: (domain: string) => {
|
||||
const unicodeDomain =
|
||||
/^(?!.*\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;
|
||||
/^(?!.*\.\.)(?!.*\.$)(?!.*\s)(?:(?!-)(?!.*--)[a-zA-Z0-9\u00A1-\uFFFF-]{1,63}(?<!-)\.)+(?!-)(?!.*--)[a-zA-Z0-9\u00A1-\uFFFF-]{2,63}$/u;
|
||||
try {
|
||||
const minMaxChars = [1, 255];
|
||||
const isValidDomainLength =
|
||||
|
||||
Reference in New Issue
Block a user