XMLHttpRequest specs state that only 'network errors' should result
in a request error, and a server side error like HTTP 500 Internal
Server Error (which results in QNetworkReply::InternalServerError)
is an indication of the HTTP server response rather than a network
error.
Change-Id: I94bf678a8487e3d31007dc5119d6fb4e87ea3102
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Valery Kotov <kotov.valery@gmail.com>
error == QNetworkReply::AuthenticationRequiredError ||
error == QNetworkReply::ContentReSendError ||
error == QNetworkReply::UnknownContentError ||
- error == QNetworkReply::ProtocolInvalidOperationError) {
+ error == QNetworkReply::ProtocolInvalidOperationError ||
+ error == QNetworkReply::InternalServerError ||
+ error == QNetworkReply::OperationNotImplementedError ||
+ error == QNetworkReply::ServiceUnavailableError ||
+ error == QNetworkReply::UnknownServerError) {
m_state = Loading;
dispatchCallback();
} else {
--- /dev/null
+HTTP/1.0 500 Internal Server Error
+Connection: close
+Content-type: text/html; charset=UTF-8
QTest::newRow("empty body") << testFileUrl("status.200.reply") << QUrl() << "";
QTest::newRow("Not Found") << testFileUrl("status.404.reply") << testFileUrl("testdocument.html") << "QML Rocks!\n";
QTest::newRow("Bad Request") << testFileUrl("status.400.reply") << testFileUrl("testdocument.html") << "QML Rocks!\n";
+ QTest::newRow("Internal server error") << testFileUrl("status.500.reply") << testFileUrl("testdocument.html") << "QML Rocks!\n";
}
void tst_qqmlxmlhttprequest::nonUtf8()