More cleanup, fix default icon dimensions
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user