Merge pull request #5851 from dokku/5845-default-nginx-domain
Allow setting _ as domain name for default nginx routing
This commit is contained in:
2 files changed
+11
-3
No files matched your search
@@ -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
|
||||||
}
|
}
|
||||||
@@ -56,6 +56,11 @@ teardown() {
|
|||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
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"
|
run /bin/bash -c "dokku domains:report $TEST_APP 2>/dev/null"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
@@ -63,6 +68,7 @@ teardown() {
|
|||||||
assert_output_contains www.test.app.dokku.me
|
assert_output_contains www.test.app.dokku.me
|
||||||
assert_output_contains 2.app.dokku.me
|
assert_output_contains 2.app.dokku.me
|
||||||
assert_output_contains a--domain.with--hyphens
|
assert_output_contains a--domain.with--hyphens
|
||||||
|
assert_output_contains _
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(domains) domains:add (multiple)" {
|
@test "(domains) domains:add (multiple)" {
|
||||||
|
|||||||
Reference in new issue
Block a user