summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2018-08-06 13:33:38 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2018-08-10 14:08:21 +0300
commit8ae5ea953e413e12813ee94d34cd0cd14bce3d8a (patch)
treea578eb9eafad6cbda5c3b59cf14b2ab246490774 /platform
parentfc0745a699a0ef60c080e9c2ff5eaecde9cb5306 (diff)
downloadqtlocation-mapboxgl-8ae5ea953e413e12813ee94d34cd0cd14bce3d8a.tar.gz
[qt] Use FollowRedirectsAttribute in network requests
Diffstat (limited to 'platform')
-rw-r--r--platform/qt/src/http_file_source.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/qt/src/http_file_source.cpp b/platform/qt/src/http_file_source.cpp
index 6e70693241..b95cfed0e9 100644
--- a/platform/qt/src/http_file_source.cpp
+++ b/platform/qt/src/http_file_source.cpp
@@ -29,6 +29,9 @@ void HTTPFileSource::Impl::request(HTTPRequest* req)
}
QNetworkRequest networkRequest = req->networkRequest();
+#if QT_VERSION >= 0x050600
+ networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
+#endif
data.first = m_manager->get(networkRequest);
connect(data.first, SIGNAL(finished()), this, SLOT(onReplyFinished()));
@@ -72,7 +75,7 @@ void HTTPFileSource::Impl::cancel(HTTPRequest* req)
void HTTPFileSource::Impl::onReplyFinished()
{
QNetworkReply* reply = qobject_cast<QNetworkReply *>(sender());
- const QUrl& url = reply->url();
+ const QUrl& url = reply->request().url();
auto it = m_pending.find(url);
if (it == m_pending.end()) {