-
Bug
-
Resolution: Invalid
-
P2: Important
-
4.7.0
-
None
by applying the following patch and adjusting the tests:
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index 44afd4d..2d5497f 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -398,7 +398,10 @@ void QNetworkAccessHttpBackend::validateCache(QHttpNetworkRequest &httpRequest,
if (lastModified.isValid())
httpRequest.setHeaderField("If-Modified-Since", QNetworkHeadersPrivate::toHttpDate(lastModified));
- if (CacheLoadControlAttribute == QNetworkRequest::PreferNetwork) {
+ if (CacheLoadControlAttribute == QNetworkRequest::PreferNetwork)
+ return; // PreferNetwork == send the request on the network with a "If-Modified-Since" header, if possible
+
+ if (CacheLoadControlAttribute == QNetworkRequest::PreferCache) {
it = cacheHeaders.findRawHeader("Cache-Control");
if (it != cacheHeaders.rawHeaders.constEnd()) {
QHash<QByteArray, QByteArray> cacheControl = parseHttpOptionHeader(it->second);