summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorBenjamin C Meyer <benjamin.meyer@torchmobile.com>2009-02-19 18:16:41 (GMT)
committerPeter Hartmann <peter.hartmann@trolltech.com>2009-03-30 15:44:22 (GMT)
commitfe6f08387f726d45536c13c00604b8290237af51 (patch)
tree771cefb313548760ebae9c096ebf66a37b24b5f5 /src/network
parentca7651e37599e0743ea37036dd3c7f891565fed8 (diff)
downloadQt-fe6f08387f726d45536c13c00604b8290237af51.zip
Qt-fe6f08387f726d45536c13c00604b8290237af51.tar.gz
Qt-fe6f08387f726d45536c13c00604b8290237af51.tar.bz2
Check for a redirection after setting the headers. If there is a redirection the location header will be used to determine where to go.
Signed-off-by: Thiago Macieira <thiago.macieira@nokia.com> Signed-off-by: Peter Hartmann <peter.hartmann@trolltech.com>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index b09e9a6..401dc71 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -888,8 +888,6 @@ bool QNetworkAccessHttpBackend::sendCacheContents(const QNetworkCacheMetaData &m
if (status < 100)
status = 200; // fake it
- checkForRedirect(status);
-
setAttribute(QNetworkRequest::HttpStatusCodeAttribute, status);
setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, attributes.value(QNetworkRequest::HttpReasonPhraseAttribute));
setAttribute(QNetworkRequest::SourceIsFromCacheAttribute, true);
@@ -900,6 +898,8 @@ bool QNetworkAccessHttpBackend::sendCacheContents(const QNetworkCacheMetaData &m
for ( ; it != end; ++it)
setRawHeader(it->first, it->second);
+ checkForRedirect(status);
+
writeDownstreamData(contents);
#if defined(QNETWORKACCESSHTTPBACKEND_DEBUG)
qDebug() << "Successfully sent cache:" << url() << contents->size() << "bytes";