Skip to content

Commit

Permalink
Allow domains with . at the end (#1110)
Browse files Browse the repository at this point in the history
Fixes #1109
  • Loading branch information
harshavardhana authored and kannappanr committed May 23, 2019
1 parent 1add5d5 commit c6c2912
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/s3utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func IsValidDomain(host string) bool {
if host[len(host)-1:] == "_" || host[:1] == "_" {
return false
}
// host cannot start or end with a "."
if host[len(host)-1:] == "." || host[:1] == "." {
// host cannot start with a "."
if host[:1] == "." {
return false
}
// All non alphanumeric characters are invalid.
Expand Down
1 change: 1 addition & 0 deletions pkg/s3utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func TestIsValidDomain(t *testing.T) {
{"s3.amz.test.com", true},
{"s3.%%", false},
{"localhost", true},
{"localhost.", true}, // http://www.dns-sd.org/trailingdotsindomainnames.html
{"-localhost", false},
{"", false},
{"\n \t", false},
Expand Down

0 comments on commit c6c2912

Please sign in to comment.