diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-07-18 10:29:17 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-22 11:24:02 +0200 |
commit | a0ad43cc834ad2a574f0cef260f7a7931e36139a (patch) | |
tree | c67a9b0f28546b4ff8d64945eb13b7059be3195c /src | |
parent | 8c19ca817bd3b2a170637119bc8c6af91ee8029f (diff) |
Use GET method for redirect in QDeclarativeXMLHttpRequest.
Initial-patch-by: Marek Więckowski <wiecko@fuw.edu.pl>
Task-number: QTBUG-32332
Change-Id: I5514d97ef8574f8e7eef8fcca39bed4cd7e917ad
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 4fa9869564..f13b240070 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; |