diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qhttpnetworkreply.cpp | 7 | ||||
-rw-r--r-- | src/network/access/qnetworkaccesshttpbackend.cpp | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp index d3d57d4..ea2018d 100644 --- a/src/network/access/qhttpnetworkreply.cpp +++ b/src/network/access/qhttpnetworkreply.cpp @@ -514,8 +514,11 @@ qint64 QHttpNetworkReplyPrivate::readHeader(QAbstractSocket *socket) chunkedTransferEncoding = headerField("transfer-encoding").toLower().contains("chunked"); // cache isConnectionCloseEnabled since it is called often - connectionCloseEnabled = (headerField("connection").toLower().contains("close") || - headerField("proxy-connection").toLower().contains("close")); + QByteArray connectionHeaderField = headerField("connection"); + // check for explicit indication of close or the implicit connection close of HTTP/1.0 + connectionCloseEnabled = (connectionHeaderField.toLower().contains("close") || + headerField("proxy-connection").toLower().contains("close")) || + (majorVersion == 1 && minorVersion == 0 && connectionHeaderField.isEmpty()); } return bytes; } diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 30f16da..faf04da 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -951,6 +951,12 @@ QNetworkCacheMetaData QNetworkAccessHttpBackend::fetchCacheMetaData(const QNetwo if (hop_by_hop) continue; + // Do not copy over the Date header because it will be + // different for every request and therefore cause a re-write to + // the disk when a 304 is received inside replyHeaderChanged() + if (header == "date") + continue; + // Don't store Warning 1xx headers if (header == "warning") { QByteArray v = rawHeader(header); |