Skip to content

Commit

Permalink
#1399[FIX] file server in subdomain with request path "/"
Browse files Browse the repository at this point in the history
Former-commit-id: 30a86cba134b87db803aa47a277795717c694c3b
  • Loading branch information
minhvh committed Dec 3, 2019
1 parent fe02ad9 commit 6dcbbc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/router/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, '/')
Expand Down
2 changes: 1 addition & 1 deletion core/router/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit 6dcbbc5

Please sign in to comment.