Http: Fix redirecting of post requests, fix #2018

This commit is contained in:
Vojtech Kral 2019-04-15 13:36:20 +02:00
parent 7aa4fd0827
commit 554176b97f

View File

@ -228,6 +228,7 @@ std::string Http::priv::body_size_error()
void Http::priv::http_perform() void Http::priv::http_perform()
{ {
::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
::curl_easy_setopt(curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL);
::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writecb); ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writecb);
::curl_easy_setopt(curl, CURLOPT_WRITEDATA, static_cast<void*>(this)); ::curl_easy_setopt(curl, CURLOPT_WRITEDATA, static_cast<void*>(this));
::curl_easy_setopt(curl, CURLOPT_READFUNCTION, form_file_read_cb); ::curl_easy_setopt(curl, CURLOPT_READFUNCTION, form_file_read_cb);