diff options
-rw-r--r-- | src/declarative/qml/qmlxmlhttprequest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlxmlhttprequest.cpp b/src/declarative/qml/qmlxmlhttprequest.cpp index 3ca61ae..65c5b16 100644 --- a/src/declarative/qml/qmlxmlhttprequest.cpp +++ b/src/declarative/qml/qmlxmlhttprequest.cpp @@ -1124,6 +1124,11 @@ void QmlXMLHttpRequest::downloadProgress(qint64 bytes) void QmlXMLHttpRequest::error(QNetworkReply::NetworkError error) { + m_status = + m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + m_statusText = + QLatin1String(m_network->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray()); + m_responseEntityBody = QByteArray(); m_errorFlag = true; m_request = QNetworkRequest(); @@ -1138,6 +1143,11 @@ void QmlXMLHttpRequest::finished() { // ### We need to transparently redirect as dictated by the spec + m_status = + m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + m_statusText = + QLatin1String(m_network->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray()); + if (m_state < HeadersReceived) { m_state = HeadersReceived; fillHeadersList (); |