Fix ExecVoteRequest sending AuthHeaders multiple times

Doesn't seem to affect libcurl, somehow.
This commit is contained in:
Tamás Bálint Misius 2023-06-18 20:47:30 +02:00
parent 0f418ec195
commit 2bc2acc00e
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -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 },
});
}