Set a descriptive User Agent for requests, so sourceforge.net does not complain.

This commit is contained in:
shainer 2016-07-15 14:02:14 +01:00
parent e462c3c8d8
commit 5e2ed69629

View File

@ -155,6 +155,9 @@ void NetInstallPage::loadGroupList()
request.setUrl( QUrl( confUrl ) ); request.setUrl( QUrl( confUrl ) );
// Follows all redirects except unsafe ones (https to http). // Follows all redirects except unsafe ones (https to http).
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
// Not everybody likes the default User Agent used by this class (looking at you,
// sourceforge.net), so let's set a more descriptive one.
request.setRawHeader( "User-Agent", "Mozilla/5.0 (compatible; Calamares)" );
connect(&m_networkManager, &QNetworkAccessManager::finished, connect(&m_networkManager, &QNetworkAccessManager::finished,
this, &NetInstallPage::dataIsHere); this, &NetInstallPage::dataIsHere);