Use dns.IsSubDomain (#112)

For the match function use the proper thing from go dns. Fix all
callers and tests to use this.

Fixes: #107
This commit is contained in:
Miek Gieben
2016-04-12 22:34:44 +01:00
parent 842953f179
commit 25cf16af0e
8 changed files with 22 additions and 22 deletions

View File

@@ -8,9 +8,9 @@ import (
// Path returns the path to the folder
// where the application may store data. This
// currently resolves to ~/.caddy
// currently resolves to ~/.coredns
func Path() string {
return filepath.Join(userHomeDir(), ".caddy")
return filepath.Join(userHomeDir(), ".coredns")
}
// userHomeDir returns the user's home directory according to

View File

@@ -6,7 +6,7 @@ import (
)
func TestPath(t *testing.T) {
if actual := Path(); !strings.HasSuffix(actual, ".caddy") {
if actual := Path(); !strings.HasSuffix(actual, ".coredns") {
t.Errorf("Expected path to be a .caddy folder, got: %v", actual)
}
}