Append "rpi-imager/version-num" to the default User-Agent when curl is
downloading the image so that image hosts can more easily distinguish
rpi-imager traffic from other traffic.
This commit is contained in:
Dave Jones 2020-05-19 19:56:32 +00:00
parent 0264af9b73
commit 3bb47b6377

View file

@ -180,6 +180,7 @@ void ImageWriter::startWrite()
connect(_thread, SIGNAL(success()), SLOT(onSuccess())); connect(_thread, SIGNAL(success()), SLOT(onSuccess()));
connect(_thread, SIGNAL(error(QString)), SLOT(onError(QString))); connect(_thread, SIGNAL(error(QString)), SLOT(onError(QString)));
_thread->setVerifyEnabled(_verifyEnabled); _thread->setVerifyEnabled(_verifyEnabled);
_thread->setUserAgent(QString("Mozilla/5.0 rpi-imager/%1").arg(constantVersion()).toUtf8());
if (!_expectedHash.isEmpty() && _cachedFileHash != _expectedHash && _cachingEnabled) if (!_expectedHash.isEmpty() && _cachedFileHash != _expectedHash && _cachingEnabled)
{ {