mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Give Subsurface a distinct User Agent string
When accessing websites (divelogs.de, subsurface website) we shouldn't pretend to be Mozilla 5. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ebdeddb9b9
commit
526ba82b53
5 changed files with 34 additions and 14 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#include "updatemanager.h"
|
||||
#include "usersurvey.h"
|
||||
#include <QtNetwork>
|
||||
#include <QMessageBox>
|
||||
#include "subsurfacewebservices.h"
|
||||
|
|
@ -24,7 +25,12 @@ void UpdateManager::checkForUpdates()
|
|||
|
||||
QString version = VERSION_STRING;
|
||||
QString url = QString("http://subsurface.hohndel.org/updatecheck.html?os=%1&ver=%2").arg(os, version);
|
||||
connect(SubsurfaceWebServices::manager()->get(QNetworkRequest(QUrl(url))), SIGNAL(finished()), this, SLOT(requestReceived()));
|
||||
QNetworkRequest request;
|
||||
request.setUrl(url);
|
||||
request.setRawHeader("Accept", "text/xml");
|
||||
QString userAgent = UserSurvey::getVersion().replace("\n", " ");
|
||||
request.setRawHeader("User-Agent", userAgent.toUtf8());
|
||||
connect(SubsurfaceWebServices::manager()->get(request), SIGNAL(finished()), this, SLOT(requestReceived()));
|
||||
}
|
||||
|
||||
void UpdateManager::requestReceived()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue