mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +00:00
#1399[FIX] file server in subdomain with request path "/"
Former-commit-id: de4326943640706a9a2f1418327c4a69bc5f85d9
This commit is contained in:
@@ -488,7 +488,11 @@ func (api *APIBuilder) HandleDir(requestPath, directory string, opts ...DirOptio
|
||||
continue
|
||||
}
|
||||
|
||||
requestPath := s.RequestPath[strings.Index(s.RequestPath, api.relativePath)+len(api.relativePath):]
|
||||
slashIdx := strings.IndexByte(s.RequestPath, '/')
|
||||
if slashIdx == -1 {
|
||||
slashIdx = 0
|
||||
}
|
||||
requestPath = s.RequestPath[slashIdx:]
|
||||
routes = append(routes, api.createRoutes([]string{http.MethodGet}, requestPath, h)...)
|
||||
getRoute.StaticSites = append(getRoute.StaticSites, s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user