trying to stop instability from happening

This commit is contained in:
Simon Martens
2025-10-02 00:08:37 +02:00
parent f61e1fdc01
commit ddd8171c08
6 changed files with 8 additions and 220 deletions

View File

@@ -21,15 +21,19 @@ func GetIssue(kgpz *xmlmodels.Library, pics *pictures.PicturesProvider) fiber.Ha
return func(c *fiber.Ctx) error {
y := c.Params("year")
yi, err := strconv.Atoi(y)
if err != nil || yi < MINYEAR || yi > MAXYEAR {
logging.Error(err, "Year is not a valid number")
if err != nil {
return c.SendStatus(fiber.StatusNotFound)
}
if yi < MINYEAR || yi > MAXYEAR {
return c.SendStatus(fiber.StatusNotFound)
}
d := c.Params("issue")
di, err := strconv.Atoi(d)
if err != nil || di < 1 {
logging.Error(err, "Issue is not a valid number")
if err != nil {
return c.SendStatus(fiber.StatusNotFound)
}
if di < 1 {
return c.SendStatus(fiber.StatusNotFound)
}