diff options
Diffstat (limited to 'controllers/404.go')
| -rw-r--r-- | controllers/404.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/controllers/404.go b/controllers/404.go deleted file mode 100644 index 670f230..0000000 --- a/controllers/404.go +++ /dev/null @@ -1,26 +0,0 @@ -package controllers - -import ( - "imageboard/utils/shortcuts" - "strings" - - "github.com/gofiber/fiber/v2" -) - -func NotFoundController(ctx *fiber.Ctx) error { - ctx.Locals("Title", "Page Not Found") - - path := ctx.Path() - - if strings.HasSuffix(path, ".json") { - return ctx.Status(fiber.StatusNotFound).JSON(fiber.Map{ - "error": "Not Found", - }) - } - - if len(path) > 1 && strings.Contains(path[1:], ".") && !strings.HasSuffix(path, ".html") { - return ctx.SendStatus(fiber.StatusNotFound) - } - - return shortcuts.Render(ctx, "404", nil) -} |
