1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-21 20:13:22 +00:00

Update filesystem.go

This commit is contained in:
Stephan Deumier 2020-09-14 16:12:46 +02:00 committed by GitHub
parent 1e171879d6
commit 58d657cb0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,6 +62,9 @@ func New(config Config) fiber.Handler {
if !strings.HasPrefix(cfg.Index, "/") {
cfg.Index = "/" + cfg.Index
}
if cfg.NotFoundFile != "" && !strings.HasPrefix(cfg.NotFoundFile, "/") {
cfg.NotFoundFile = "/" + cfg.NotFoundFile
}
if cfg.Root == nil {
log.Fatal("filesystem: Root cannot be nil")
}