Switch to modernc.org/sqlite and update dockerfile
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user