diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-07-18 10:22:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-22 10:03:40 +0200 |
commit | e0f7b22341339b77aafa9150b0d79e320e9e4180 (patch) | |
tree | 2f1d034857143389e66b2cb21b2db4f9dd0c1c78 | |
parent | cb9d1a61b127030562a206c0142d99997eb82c8e (diff) |
Use GET method for redirect in QDeclarativeXMLHttpRequest.
Initial-patch-by: Marek Więckowski <wiecko@fuw.edu.pl>
Task-number: QTBUG-32332
Change-Id: I393308134d60e484464e0cfc6cdcdac1edc27f8d
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
-rw-r--r-- | src/declarative/qml/qdeclarativexmlhttprequest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp index e8f1a85b..5fd23600 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp @@ -1270,6 +1270,11 @@ void QDeclarativeXMLHttpRequest::finished() if (redirect.isValid()) { QUrl url = m_network->url().resolved(redirect.toUrl()); if (url.scheme() != QLatin1String("file")) { + // See http://www.ietf.org/rfc/rfc2616.txt, section 10.3.4 "303 See Other": + // Result of 303 redirection should be a new "GET" request. + const QVariant code = m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute); + if (code.isValid() && code.toInt() == 303 && m_method != QLatin1String("GET")) + m_method = QStringLiteral("GET"); destroyNetwork(); requestFromUrl(url); return; |