mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-22 14:33:29 +00:00
Merge pull request #780 from AzSiAz/fix-NotFoundFile-path-to-add-"/"-like-for-Index
🐛 Update filesystem.go to fix NotFoundFile
This commit is contained in:
commit
2e2bb24972
@ -62,6 +62,9 @@ func New(config Config) fiber.Handler {
|
|||||||
if !strings.HasPrefix(cfg.Index, "/") {
|
if !strings.HasPrefix(cfg.Index, "/") {
|
||||||
cfg.Index = "/" + cfg.Index
|
cfg.Index = "/" + cfg.Index
|
||||||
}
|
}
|
||||||
|
if cfg.NotFoundFile != "" && !strings.HasPrefix(cfg.NotFoundFile, "/") {
|
||||||
|
cfg.NotFoundFile = "/" + cfg.NotFoundFile
|
||||||
|
}
|
||||||
if cfg.Root == nil {
|
if cfg.Root == nil {
|
||||||
log.Fatal("filesystem: Root cannot be nil")
|
log.Fatal("filesystem: Root cannot be nil")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user