diff options
-rw-r--r-- | server.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server.go b/server.go index 5ed4561..9238c73 100644 --- a/server.go +++ b/server.go @@ -101,12 +101,12 @@ func main() { files := http.FS(fs) notFoundHandler := func(c *fiber.Ctx) error { c.Status(fiber.StatusNotFound).Type("html", "utf-8") - content, err := fs.ReadFile("public/404.html") + content, err := files.Open("public/404.html") if err != nil { - content = []byte("404 Not Found") c.Type("txt") + return c.SendString("404 Not Found") } - return c.Send(content) + return c.SendStream(content) } website.Get("/404.html", notFoundHandler) website.Use("/", filesystem.New(filesystem.Config{ |