Merge pull request #1352 from sburavtsov/HttpClientFix-FOLLOW_LOCATION

To be able to handle 302 redirects with curl we need to set option CURLOPT_FOLLOWLOCATION
This commit is contained in:
Walzer 2012-09-20 18:20:46 -07:00
commit befaf686bb
1 changed files with 6 additions and 0 deletions

View File

@ -252,6 +252,12 @@ int processGetTask(CCHttpRequest *request, write_callback callback, void *stream
break;
}
code = curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, request->getUrl());
if (code != CURLE_OK)
{
break;
}
code = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, callback);
if (code != CURLE_OK)
{