From bf3d6ecb83d20aee190dc5d3b62290183947adde Mon Sep 17 00:00:00 2001 From: Jacob Gunther Date: Sun, 19 May 2024 13:13:29 -0500 Subject: [PATCH] Enforce Votifier version --- src/routes.go | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/routes.go b/src/routes.go index 21df249..765d307 100644 --- a/src/routes.go +++ b/src/routes.go @@ -170,12 +170,13 @@ func SendVoteHandler(ctx *fiber.Ctx) error { defer cancel() if err = mcutil.SendVote(c, opts.Host, opts.Port, options.Vote{ - PublicKey: opts.PublicKey, - ServiceName: opts.ServiceName, - Username: opts.Username, - IPAddress: opts.IPAddress, - Timestamp: opts.Timestamp, - Timeout: opts.Timeout, + RequireVersion: 1, + PublicKey: opts.PublicKey, + ServiceName: opts.ServiceName, + Username: opts.Username, + IPAddress: opts.IPAddress, + Timestamp: opts.Timestamp, + Timeout: opts.Timeout, }); err != nil { return ctx.Status(http.StatusBadRequest).SendString(err.Error()) } @@ -187,12 +188,13 @@ func SendVoteHandler(ctx *fiber.Ctx) error { defer cancel() if err = mcutil.SendVote(c, opts.Host, opts.Port, options.Vote{ - ServiceName: opts.ServiceName, - Username: opts.Username, - Token: opts.Token, - UUID: opts.UUID, - Timestamp: opts.Timestamp, - Timeout: opts.Timeout, + RequireVersion: 2, + ServiceName: opts.ServiceName, + Username: opts.Username, + Token: opts.Token, + UUID: opts.UUID, + Timestamp: opts.Timestamp, + Timeout: opts.Timeout, }); err != nil { return ctx.Status(http.StatusBadRequest).SendString(err.Error()) }