Merge pull request #2360 from xadh00m/fix_domain_validation

Allow hyphen in TLD
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2016-08-26 14:17:17 -04:00
commit e0e9c3f72c
2 files changed
+5 -1

No files matched your search

+1 -1
View File
@@ -1065,7 +1065,7 @@ strip_inline_comments() {
is_valid_hostname() { 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_regex='^(([a-z0-9\*](-?[a-z0-9])*)\.)*[a-z0-9\*](-?[a-z0-9])+\.[a-z]{2,}$' local hostname_string="${1,,}"; local hostname_regex='^([a-z0-9\*-]+\.)*[a-z0-9\*-]+$'
if [[ $hostname_string =~ $hostname_regex ]]; then if [[ $hostname_string =~ $hostname_regex ]]; then
return 0 return 0
else else
+4
View File
@@ -37,6 +37,10 @@ teardown() {
echo "output: "$output echo "output: "$output
echo "status: "$status echo "status: "$status
assert_success assert_success
run dokku domains:add $TEST_APP a--domain.with--hyphens
echo "output: "$output
echo "status: "$status
assert_success
} }
@test "(domains) domains:add (multiple)" { @test "(domains) domains:add (multiple)" {