aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlxmlhttprequest.cpp
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@qt.io>2020-08-20 17:57:25 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2020-08-20 18:16:03 +0000
commitbb1ad6e425bf758ddaa974adb14e9b8389037611 (patch)
tree93cb1f15c8106dd4f11e35d602b61b01922e49fc /src/qml/qml/qqmlxmlhttprequest.cpp
parentac68310b7857693c9eb7ccb782133ac9ec8e2328 (diff)
Adapt to QNetworkRequest change
In d12afeff4097dd78f1311511e0c8f74e1a810d47 the default for redirection handling was changed from manual to NoLessSafeRedirectPolicy. This makes the redirection handling asynchronous, leading to a failure in tst_qqmlxmlhttprequest::redirects. In it the request is not finished after component.completeCreate(). Thus the property dataOK is read before being set to true, and the test fails. This change reestablishes the ManualRedirectPolicy, giving the old behavior, and fixes a failure blocking CI. Change-Id: I525b1229b4ce8cfb814bdb66f86f745ea05c1b5c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlxmlhttprequest.cpp')
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index aeb57a7768..7a2f6f4537 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -1217,6 +1217,7 @@ void QQmlXMLHttpRequest::requestFromUrl(const QUrl &url)
}
}
+ request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::ManualRedirectPolicy);
request.setUrl(url);
if(m_method == QLatin1String("POST") ||
m_method == QLatin1String("PUT")) {