Add 404 page

This commit is contained in:
video-prize-ranch
2022-05-23 11:30:17 -04:00
parent 6eee86d682
commit d05f7f868d
6 changed files with 41 additions and 4 deletions

View File

@@ -32,6 +32,11 @@ func handleMedia(c *fiber.Ctx, url string) error {
return err
}
if res.StatusCode == 404 {
c.Status(404)
return c.Render("errors/404", nil)
}
c.Set("Content-Type", res.Header.Get("Content-Type"));
contentLen, _ := strconv.Atoi(res.Header.Get("Content-Length"))
return c.SendStream(res.Body, contentLen)