summaryrefslogtreecommitdiff
path: root/platform/qt/src/http_file_source.cpp
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:35:38 +0300
commit4b85252fbe811a786c6ee9eabedb7639b031dc53 (patch)
tree86ab7216de9d504d01cc9d06b8a021647210498b /platform/qt/src/http_file_source.cpp
parentd1f1ef922f329f3a5f729c34dde615d5afeb5ac6 (diff)
downloadqtlocation-mapboxgl-4b85252fbe811a786c6ee9eabedb7639b031dc53.tar.gz
[qt] Use FollowRedirectsAttribute in network requests
Diffstat (limited to 'platform/qt/src/http_file_source.cpp')
-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()) {