send 404 on messing binary

This commit is contained in:
Niko Abeler 2023-07-27 20:56:26 +02:00
parent 40117dab37
commit 0de18e89fc
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ func (h *MediaHandler) Handle(c *fiber.Ctx) error {
}
binary, err := h.binaryService.FindById(id)
if err != nil {
return err
return c.SendStatus(fiber.StatusNotFound)
}
c.Set("Content-Type", binary.Mime())
return c.Send(binary.Data)