Added a flag for controlling calling fetch_curl_header