diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-07-20 16:43:11 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-07-20 17:21:14 +0300 |
commit | 15056f96547119c37b106065b58a3d70e537ea4e (patch) | |
tree | 8d70ebce7e3bdfa2d2d1f392192d50cc8c6cc2a8 /platform/qt | |
parent | f19c36a4ba9adb6d1288a47252a0189aac5033ce (diff) | |
download | qtlocation-mapboxgl-15056f96547119c37b106065b58a3d70e537ea4e.tar.gz |
[Qt] Use the Qt release version and Qt Framework version on the user agent
Diffstat (limited to 'platform/qt')
-rw-r--r-- | platform/qt/src/http_request.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/qt/src/http_request.cpp b/platform/qt/src/http_request.cpp index 6141216c65..ef753c3e0e 100644 --- a/platform/qt/src/http_request.cpp +++ b/platform/qt/src/http_request.cpp @@ -6,6 +6,7 @@ #include <mbgl/util/optional.hpp> #include <mbgl/util/http_header.hpp> #include <mbgl/util/string.hpp> +#include <mbgl/util/version.hpp> #include <QByteArray> #include <QNetworkReply> @@ -37,7 +38,9 @@ QNetworkRequest HTTPRequest::networkRequest() const { QNetworkRequest req = QNetworkRequest(requestUrl()); req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); - req.setRawHeader("User-Agent", "MapboxGL/1.0 [Qt]"); + + static const QByteArray agent = QString("MapboxGL/%1 (Qt %2)").arg(version::revision).arg(QT_VERSION_STR).toLatin1(); + req.setRawHeader("User-Agent", agent); if (m_resource.priorEtag) { const auto etag = m_resource.priorEtag; |