diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-01-09 13:54:45 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2023-01-11 10:14:47 +0000 |
commit | 071c66521c6db7136ea7f4606d48ab9fbcc4c71d (patch) | |
tree | 08af44c98948595bfb9fb7cf2b6b1666be06e4b9 /desktop | |
parent | 0bd3600d9415c10891ea1d90dd598d827d1a9c48 (diff) |
Fix types for Curl elements (update part)
"CURLOPT_REDIR_PROTOCOLS_STR" has been added with Curl 7.85
so check if Curl version is 7.85 min or use the previous version "CURLOPT_REDIR_PROTOCOLS"
Change-Id: Iacf6a3c37aba63d615eaa93352b098b1c9183533
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145208
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/updater.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 9f60a64d7235..f74dfbeceb6e 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -563,7 +563,11 @@ std::string download_content(const OString& rURL, bool bFile, OUString& rHash) curl_easy_setopt(curl.get(), CURLOPT_HTTPHEADER, headerlist); curl_easy_setopt(curl.get(), CURLOPT_FOLLOWLOCATION, 1); // follow redirects // only allow redirect to http:// and https:// - curl_easy_setopt(curl.get(), CURLOPT_REDIR_PROTOCOLS_STR, CURLPROTO_HTTP | CURLPROTO_HTTPS); +#if (LIBCURL_VERSION_MAJOR > 7) || (LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 85) + curl_easy_setopt(curl.get(), CURLOPT_REDIR_PROTOCOLS_STR, "http,https"); +#else + curl_easy_setopt(curl.get(), CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); +#endif std::string response_body; utl::TempFileNamed aTempFile; |