From 2bc2acc00ed9c70d601cf0204e386d5d30ec29d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Sun, 18 Jun 2023 20:47:30 +0200 Subject: [PATCH] Fix ExecVoteRequest sending AuthHeaders multiple times Doesn't seem to affect libcurl, somehow. --- src/client/http/ExecVoteRequest.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/client/http/ExecVoteRequest.cpp b/src/client/http/ExecVoteRequest.cpp index 6839ef3d2..0659eb911 100644 --- a/src/client/http/ExecVoteRequest.cpp +++ b/src/client/http/ExecVoteRequest.cpp @@ -8,17 +8,10 @@ namespace http APIRequest(ByteString::Build(SCHEME, SERVER, "/Vote.api"), authRequire, false), direction(newDirection) { - auto user = Client::Ref().GetAuthUser(); - if (!user.UserID) - { - FailEarly("Not authenticated"); - return; - } - AuthHeaders(ByteString::Build(user.UserID), user.SessionID); AddPostData(FormData{ { "ID", ByteString::Build(saveID) }, { "Action", direction ? (direction == 1 ? "Up" : "Down") : "Reset" }, - { "Key", user.SessionKey }, + { "Key", Client::Ref().GetAuthUser().SessionKey }, }); }