Merge pull request #5851 from dokku/5845-default-nginx-domain

Allow setting _ as domain name for default nginx routing
This commit is contained in:
josegonzalez
2023-05-13 15:30:11 -04:00
committed by GitHub
2 changed files with 11 additions and 3 deletions

View File

@@ -276,9 +276,11 @@ is_valid_hostname() {
declare desc="return 0 if argument is a valid hostname; else return 1"
local hostname_string="${1,,}"
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
else
return 1
fi
return 1
}

View File

@@ -56,6 +56,11 @@ teardown() {
echo "status: $status"
assert_success
run /bin/bash -c "dokku domains:add $TEST_APP _"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku domains:report $TEST_APP 2>/dev/null"
echo "output: $output"
echo "status: $status"
@@ -63,6 +68,7 @@ teardown() {
assert_output_contains www.test.app.dokku.me
assert_output_contains 2.app.dokku.me
assert_output_contains a--domain.with--hyphens
assert_output_contains _
}
@test "(domains) domains:add (multiple)" {