mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Merge pull request #2258 from dokku/2257_mh-domains-regex
support domains that start with digits per RFC1123
This commit is contained in:
@@ -1057,7 +1057,7 @@ strip_inline_comments() {
|
||||
|
||||
is_valid_hostname() {
|
||||
declare desc="return 0 if argument is a valid hostname; else return 1"
|
||||
local hostname_string="$1"; local hostname_regex='^(([a-zA-Z\*](-?[a-zA-Z0-9])*)\.)*[a-zA-Z\*](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}$'
|
||||
local hostname_string="$1"; local hostname_regex='^(([a-zA-Z0-9\*](-?[a-zA-Z0-9])*)\.)*[a-zA-Z\*](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}$'
|
||||
if [[ $hostname_string =~ $hostname_regex ]]; then
|
||||
return 0
|
||||
else
|
||||
|
||||
@@ -31,10 +31,14 @@ teardown() {
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
run dokku domains:add $TEST_APP 2.app.dokku.me
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(domains) domains:add (multiple)" {
|
||||
run dokku domains:add $TEST_APP www.test.app.dokku.me test.app.dokku.me
|
||||
run dokku domains:add $TEST_APP 2.app.dokku.me www.test.app.dokku.me test.app.dokku.me
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
Reference in New Issue
Block a user