mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-19 13:47:54 +00:00
fix static routing for index.html
This commit is contained in:
parent
6e9fae815a
commit
53d79ca070
@ -241,12 +241,14 @@ func (app *App) registerStatic(prefix, root string, config ...Static) *Route {
|
||||
path := ctx.Path()
|
||||
if len(path) >= prefixLen {
|
||||
if isStar && getString(path[0:prefixLen]) == prefix {
|
||||
path = path[0:0]
|
||||
path = append(path[0:0], '/')
|
||||
} else {
|
||||
path = path[prefixLen:]
|
||||
path = append(path[prefixLen:], '/')
|
||||
}
|
||||
}
|
||||
path = append([]byte("/"), path...)
|
||||
if len(path) > 0 && path[0] != '/' {
|
||||
path = append([]byte("/"), path...)
|
||||
}
|
||||
return path
|
||||
},
|
||||
PathNotFound: func(ctx *fasthttp.RequestCtx) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user