From 1073aa089ad55eb5e8ff0d38b11285c3bd69241e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 18 Jul 2013 10:22:21 +0200 Subject: Use GET method for redirect in QDeclarativeXMLHttpRequest. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initial-patch-by: Marek Więckowski Task-number: QTBUG-32332 Change-Id: I393308134d60e484464e0cfc6cdcdac1edc27f8d Reviewed-by: Peter Hartmann (cherry picked from qtquick1/e0f7b22341339b77aafa9150b0d79e320e9e4180) --- src/declarative/qml/qdeclarativexmlhttprequest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp index 4aede8b..fe4538d 100644 --- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp +++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp @@ -1273,6 +1273,11 @@ void QDeclarativeXMLHttpRequest::finished() if (redirect.isValid()) { QUrl url = m_network->url().resolved(redirect.toUrl()); if (url.scheme().toLower() != 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 = QLatin1String("GET"); destroyNetwork(); requestFromUrl(url); return; -- cgit v0.12