aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlxmlhttprequest.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-04-08 13:37:19 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-08 17:38:39 +0200
commit4e1cdab23c42d40fef474fca43fc431907cd18c1 (patch)
treeff1228cc92fa4740c946c0330981ab13018b7438 /src/qml/qml/qqmlxmlhttprequest.cpp
parent2ab6a34a7e9c307a43c23262aeee398dc5fb91bc (diff)
Fix XHR auto tests always failing
The test (rightly so) expects that even for a 400 response, the responseBody must be preserved - as per commit 0949071f13e7bcbc16a0f07f496e0b6a23b04edd. However before commit fd5dd2712656cbc674c8360754394e41dd82e40c in qtbase, 400 was mapped to QNetworkReply::UnknownContentError, which is "handled" by QQmlXMLHttpRequest::error in the sense that the body is preserved. After the qtbase behavioral change, 400 now maps to QNetworkReply::ProtocolInvalidOperationError, which was _not_ handled, the body was cleared and the test failed. The revdep of qtdeclarative for qtbase should've caught the behavioral change in qtbase, but unfortunately the auto-test was disabled (marked insignificant). This patch adjusts the xhr implementation to the behavioral change in qtbase and also re-activates the xhr auto-test (we really should be testing our xhr implementation in the CI system...). Task-number: QTBUG-38180 Change-Id: I7655fd9037752ad644a98d01257bf5f81e7daa15 Reviewed-by: Mandeep Sandhu <mandeepsandhu.chd@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Diffstat (limited to 'src/qml/qml/qqmlxmlhttprequest.cpp')
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index fd27903b74..184a9fe51f 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -1388,7 +1388,8 @@ void QQmlXMLHttpRequest::error(QNetworkReply::NetworkError error)
error == QNetworkReply::ContentNotFoundError ||
error == QNetworkReply::AuthenticationRequiredError ||
error == QNetworkReply::ContentReSendError ||
- error == QNetworkReply::UnknownContentError) {
+ error == QNetworkReply::UnknownContentError ||
+ error == QNetworkReply::ProtocolInvalidOperationError) {
m_state = Loading;
dispatchCallback(me);
} else {