From e0f7b22341339b77aafa9150b0d79e320e9e4180 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 --- src/declarative/qml/qdeclarativexmlhttprequest.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/declarative') 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; -- cgit v1.2.3