mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-05 03:50:07 +00:00
Clear http headers after redirects
This commit is contained in:
parent
b439452edd
commit
c6249d2214
1 changed files with 9 additions and 2 deletions
|
|
@ -143,7 +143,7 @@ private:
|
|||
&& curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, StaticCurlWrite) == CURLE_OK
|
||||
&& curl_easy_setopt (curl, CURLOPT_MAXREDIRS, static_cast<long> (maxRedirects)) == CURLE_OK
|
||||
&& curl_easy_setopt (curl, CURLOPT_USERAGENT, userAgent.toRawUTF8()) == CURLE_OK
|
||||
&& curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1) == CURLE_OK)
|
||||
&& curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, (maxRedirects > 0 ? 1 : 0)) == CURLE_OK)
|
||||
{
|
||||
if (isPost)
|
||||
{
|
||||
|
|
@ -441,10 +441,17 @@ private:
|
|||
|
||||
size_t len = size * nmemb;
|
||||
|
||||
curlHeaders += String (ptr, len);
|
||||
String header (ptr, len);
|
||||
|
||||
if (! header.contains (":") && header.startsWithIgnoreCase ("HTTP/"))
|
||||
curlHeaders.clear();
|
||||
else
|
||||
curlHeaders += header;
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
//==============================================================================
|
||||
// Static method wrappers
|
||||
static size_t StaticCurlWrite (char* ptr, size_t size, size_t nmemb, void* userdata)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue