1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00

Merge pull request #1922 from H3rnand3zzz/fix/plugins-install-follow-redirect

Allow redirects for  `/plugins install` and add emptiness check for downloaded files
This commit is contained in:
Michael Vetter 2023-11-10 22:10:31 +01:00 committed by GitHub
commit 1d3378a583
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();