mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-07 08:56:30 +02:00
Fix ExecVoteRequest sending AuthHeaders multiple times
Doesn't seem to affect libcurl, somehow.
This commit is contained in:
@@ -8,17 +8,10 @@ namespace http
|
|||||||
APIRequest(ByteString::Build(SCHEME, SERVER, "/Vote.api"), authRequire, false),
|
APIRequest(ByteString::Build(SCHEME, SERVER, "/Vote.api"), authRequire, false),
|
||||||
direction(newDirection)
|
direction(newDirection)
|
||||||
{
|
{
|
||||||
auto user = Client::Ref().GetAuthUser();
|
|
||||||
if (!user.UserID)
|
|
||||||
{
|
|
||||||
FailEarly("Not authenticated");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
AuthHeaders(ByteString::Build(user.UserID), user.SessionID);
|
|
||||||
AddPostData(FormData{
|
AddPostData(FormData{
|
||||||
{ "ID", ByteString::Build(saveID) },
|
{ "ID", ByteString::Build(saveID) },
|
||||||
{ "Action", direction ? (direction == 1 ? "Up" : "Down") : "Reset" },
|
{ "Action", direction ? (direction == 1 ? "Up" : "Down") : "Reset" },
|
||||||
{ "Key", user.SessionKey },
|
{ "Key", Client::Ref().GetAuthUser().SessionKey },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user