Switch to modernc.org/sqlite and update dockerfile

This commit is contained in:
2026-05-06 19:00:28 +02:00
parent b28b9b127b
commit e5fd59f3ed
16 changed files with 162 additions and 127 deletions
+5 -2
View File
@@ -2,10 +2,13 @@ package middleware
import "github.com/gofiber/fiber/v3"
func APIHostGuard(allowedHost string) fiber.Handler {
func APIHostGuard(allowedHost string, alternativeHandler fiber.Handler) fiber.Handler {
return func(c fiber.Ctx) error {
if c.Hostname() != allowedHost {
return c.Status(fiber.StatusNotFound).SendString("Not Found")
if alternativeHandler != nil {
return alternativeHandler(c)
}
return c.Status(fiber.StatusForbidden).SendString("Forbidden: Invalid API host")
}
return c.Next()
}