diff --git a/core/router/path.go b/core/router/path.go index 6d9b687a..61d7e065 100644 --- a/core/router/path.go +++ b/core/router/path.go @@ -233,7 +233,7 @@ func splitSubdomainAndPath(fullUnparsedPath string) (subdomain string, path stri splitPath := strings.Split(s, ".") if len(splitPath) == 2 && splitPath[1] == "" { - return splitPath[0] + ".", "/" + return splitPath[0], "/" } slashIdx := strings.IndexByte(s, '/') diff --git a/core/router/path_test.go b/core/router/path_test.go index bdf2d4ad..d9b36ff6 100644 --- a/core/router/path_test.go +++ b/core/router/path_test.go @@ -116,7 +116,7 @@ func TestSplitSubdomainAndPath(t *testing.T) { path string }{ {"admin./users/42", "admin.", "/users/42"}, - {"admin.", "admin.", "/"}, + {"admin.", "admin", "/"}, {"admin./" + WildcardFileParam(), "admin.", "/" + WildcardFileParam()}, {"//api/users\\42", "", "/api/users/42"}, {"admin./users//42", "admin.", "/users/42"},