diff options
author | Mårten Nordheim <morten242@gmail.com> | 2020-08-13 13:23:32 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-09-01 22:50:32 +0300 |
commit | d3101bbc22edd41c9036ea487d4a71eabd97823d (patch) | |
tree | 96f892e526c4729570256192a4b8dcf8ca1f863e | |
parent | 5dbbb966fe8b7e0d567679103218c1fc487c5446 (diff) | |
download | qtlocation-mapboxgl-upstream/qt-staging.tar.gz |
Update Qt redirection handlingupstream/qt-staging
Since 5.9 RedirectPolicyAttribute is preferred, and from 6.0 the
behavior of NoLessSafeRedirectPolicy is the default.
-rw-r--r-- | platform/qt/src/http_file_source.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/qt/src/http_file_source.cpp b/platform/qt/src/http_file_source.cpp index b95cfed0e9..a3dd23a025 100644 --- a/platform/qt/src/http_file_source.cpp +++ b/platform/qt/src/http_file_source.cpp @@ -29,8 +29,13 @@ void HTTPFileSource::Impl::request(HTTPRequest* req) } QNetworkRequest networkRequest = req->networkRequest(); -#if QT_VERSION >= 0x050600 +#if QT_VERSION < 0x060000 +# if QT_VERSION >= 0x050900 + networkRequest.setAttribute(QNetworkRequest::RedirectPolicyAttribute, + QNetworkRequest::NoLessSafeRedirectPolicy); +# elif QT_VERSION >= 0x050600 networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); +# endif #endif data.first = m_manager->get(networkRequest); |