diff --git a/funcs/func_curl.c b/funcs/func_curl.c index 3e09d1cbe78337ec6ff6913502bf5ac450b7f4e7..cc3b195f2884a3ac7594bb77bd2640fd72c5cae7 100644 --- a/funcs/func_curl.c +++ b/funcs/func_curl.c @@ -721,9 +721,10 @@ static int acf_curl_helper(struct ast_channel *chan, struct curl_args *args) curl_easy_setopt(*curl, CURLOPT_POSTFIELDS, args->postdata); } - if (headers) { - curl_easy_setopt(*curl, CURLOPT_HTTPHEADER, headers); - } + /* Always assign the headers - even when NULL - in case we had + * custom headers the last time we used this shared cURL + * instance */ + curl_easy_setopt(*curl, CURLOPT_HTTPHEADER, headers); /* Temporarily assign a buffer for curl to write errors to. */ curl_errbuf[0] = curl_errbuf[CURL_ERROR_SIZE] = '\0';