1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-10 05:25:58 +00:00

#1399 [BUG]Can't set file server in subdomain with request path is "/"

Former-commit-id: 2914cafeab26ae8a716138bec95ade6953ddd04b
This commit is contained in:
minhvh93
2019-12-02 20:35:15 +07:00
parent 4e9a6be9aa
commit 42dcc259e7
2 changed files with 7 additions and 0 deletions

View File

@@ -231,6 +231,11 @@ func splitSubdomainAndPath(fullUnparsedPath string) (subdomain string, path stri
return "", "/"
}
splitPath := strings.Split(s, ".")
if len(splitPath) == 2 && splitPath[1] == "" {
return splitPath[0] + ".", "/"
}
slashIdx := strings.IndexByte(s, '/')
if slashIdx > 0 {
// has subdomain