mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 18:37:05 +00:00
PR #1400 and resolve conflict
Former-commit-id: cb7e939045f72653827a111c6ccdc2af8e456b02
This commit is contained in:
@@ -492,7 +492,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