diff --git a/src/tools/http_download.c b/src/tools/http_download.c index b58e9290b..89dac431b 100644 --- a/src/tools/http_download.c +++ b/src/tools/http_download.c @@ -159,6 +159,8 @@ http_file_get(void* userdata) curl_easy_setopt(curl, CURLOPT_USERAGENT, "profanity"); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + if (cafile) { curl_easy_setopt(curl, CURLOPT_CAINFO, cafile); } @@ -174,6 +176,10 @@ http_file_get(void* userdata) err = strdup(curl_easy_strerror(res)); } + if (ftell(outfh) == 0) { + err = strdup("Output file is empty."); + } + curl_easy_cleanup(curl); curl_global_cleanup();