fix: update regex for server name validation to respect RFC1035

This commit is contained in:
Théophile Diot 2024-11-19 16:14:41 +01:00
parent 9f737f9fec
commit d2578d31ea
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -50,7 +50,7 @@
"help": "List of the virtual hosts served by bunkerweb.",
"id": "server-name",
"label": "Server name",
"regex": "^((\\S{1,255})(?!.*\\s\\2(\\s|$)))?(\\s(\\S{1,255})(?!.*\\s\\5(\\s|$)))*$",
"regex": "^(((?!.*\\.\\.)(?!.{256,})([A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63})(?!.*\\s\\2(\\s|$)))?(\\s(((?!.*\\.\\.)(?!.{256,})([A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}))(?!.*\\s\\5(\\s|$)))*$",
"type": "text"
},
"WORKER_PROCESSES": {