diff --git a/middleware/filesystem/filesystem.go b/middleware/filesystem/filesystem.go index f4f3f435..87c23c96 100644 --- a/middleware/filesystem/filesystem.go +++ b/middleware/filesystem/filesystem.go @@ -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") }