More cleanup, fix default icon dimensions

This commit is contained in:
Jacob Gunther
2022-08-25 16:39:28 -05:00
parent 738fb77832
commit f7ae8a539b
6 changed files with 68 additions and 44 deletions

View File

@@ -66,12 +66,16 @@ func IconHandler(ctx *fiber.Ctx) error {
return ctx.Status(http.StatusBadRequest).SendString("Invalid address value")
}
icon, err := GetServerIcon(host, port)
icon, expiresAt, err := GetServerIcon(host, port)
if err != nil {
return err
}
if expiresAt != nil {
ctx.Set("X-Cache-Time-Remaining", strconv.Itoa(int(expiresAt.Seconds())))
}
return ctx.Type("png").Send(icon)
}