diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-07-18 08:22:21 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-22 11:44:39 (GMT) |
commit | 1073aa089ad55eb5e8ff0d38b11285c3bd69241e (patch) | |
tree | 73a94216c4a9b74e1eb0c7973f44b0d92351634e /src | |
parent | 1aa516ccf3db45d66a7f29595c4a057e144858ec (diff) | |
download | Qt-1073aa089ad55eb5e8ff0d38b11285c3bd69241e.zip Qt-1073aa089ad55eb5e8ff0d38b11285c3bd69241e.tar.gz Qt-1073aa089ad55eb5e8ff0d38b11285c3bd69241e.tar.bz2 |
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>
(cherry picked from qtquick1/e0f7b22341339b77aafa9150b0d79e320e9e4180)
Diffstat (limited to 'src')
-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 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; |