feat: allow setting _ as domain name for default nginx routing

Closes #5845
This commit is contained in:
josegonzalez authored and GitHub committed 2023-05-13 13:56:23 -04:00
1 parent ea910d38d3
commit fd1f80c485
1 file changed
+5 -3
+5 -3
View File
@@ -276,9 +276,11 @@ is_valid_hostname() {
declare desc="return 0 if argument is a valid hostname; else return 1" declare desc="return 0 if argument is a valid hostname; else return 1"
local hostname_string="${1,,}" local hostname_string="${1,,}"
local hostname_regex='^[a-z0-9\.\*-]*[a-z0-9\*-]$' local hostname_regex='^[a-z0-9\.\*-]*[a-z0-9\*-]$'
if [[ $hostname_string =~ $hostname_regex ]]; then if [[ "$hostname_string" == "_" ]]; then
return 0
elif [[ $hostname_string =~ $hostname_regex ]]; then
return 0 return 0
else
return 1
fi fi
return 1
} }