mirror of
https://github.com/Nezumi-2711/cloudflare-gateway-pihole-scripts.git
synced 2026-09-22 05:31:50 +00:00
use more accurate domain regex pattern
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ if (!globalThis.fetch) {
|
||||
* @param {string} value The value to be checked.
|
||||
*/
|
||||
export const isValidDomain = (value) =>
|
||||
/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(
|
||||
/^\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b$/.test(
|
||||
value
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user