diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-08-06 13:33:38 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-08-10 14:35:38 +0300 |
commit | 4b85252fbe811a786c6ee9eabedb7639b031dc53 (patch) | |
tree | 86ab7216de9d504d01cc9d06b8a021647210498b | |
parent | d1f1ef922f329f3a5f729c34dde615d5afeb5ac6 (diff) |
[qt] Use FollowRedirectsAttribute in network requests
-rw-r--r-- | platform/qt/src/http_file_source.cpp | 5 |
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 6e7069324..b95cfed0e 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()) { |