Only make the request a POST if POST parameters are present

This is a compatibility thing, eww. This also fixes handling ptsave from the command line.
This commit is contained in:
Tamás Bálint Misius 2020-01-21 22:54:52 +01:00
parent 7330d0412a
commit 5dfda0c528
No account linked to committer's email address

View File

@ -330,7 +330,10 @@ namespace http
ByteString Request::SimpleAuth(ByteString uri, int *status, ByteString ID, ByteString session, std::map<ByteString, ByteString> post_data)
{
Request *request = new Request(uri);
request->AddPostData(post_data);
if (!post_data.empty())
{
request->AddPostData(post_data);
}
request->AuthHeaders(ID, session);
request->Start();
return request->Finish(status);