mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 00:39:43 -05:00
Merge pull request #1657 from keepassxreboot/hotfix/1573-curl-download-hang
Add User-Agent header and set request timeout to avoid infinite download hangs
This commit is contained in:
commit
4ce0005711
@ -197,12 +197,12 @@ QImage EditWidgetIcons::fetchFavicon(const QUrl& url)
|
||||
curl_easy_setopt(curl, CURLOPT_URL, baUrl.data());
|
||||
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 5L);
|
||||
curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl");
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 5L);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10L);
|
||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &imagedata);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &writeCurlResponse);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
|
||||
#ifdef Q_OS_WIN
|
||||
const QDir appDir = QFileInfo(QCoreApplication::applicationFilePath()).absoluteDir();
|
||||
if (appDir.exists("ssl\\certs")) {
|
||||
|
Loading…
Reference in New Issue
Block a user