From: Friedemann Kleint Date: Thu, 18 Jul 2013 08:29:17 +0000 (+0200) Subject: Use GET method for redirect in QDeclarativeXMLHttpRequest. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=a0ad43cc834ad2a574f0cef260f7a7931e36139a;p=konrad%2Fqtdeclarative.git Use GET method for redirect in QDeclarativeXMLHttpRequest. Initial-patch-by: Marek Więckowski Task-number: QTBUG-32332 Change-Id: I5514d97ef8574f8e7eef8fcca39bed4cd7e917ad Reviewed-by: Peter Hartmann --- diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 4fa9869..f13b240 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -1339,6 +1339,11 @@ void QQmlXMLHttpRequest::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;