Initial-patch-by: Marek Więckowski <wiecko@fuw.edu.pl>
Task-number: QTBUG-32332
Change-Id: I5514d97ef8574f8e7eef8fcca39bed4cd7e917ad
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
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;