Ensure that Proxy-Connection: Keep-Alive is respected for HTTP 1.0
authorAndy Shaw <andy.shaw@digia.com>
Fri, 22 Jun 2012 08:45:51 +0000 (10:45 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 22 Jun 2012 09:47:24 +0000 (11:47 +0200)
When doing a NTML authentication it would close the connection after
the second phase before replying when the reply was a HTTP 1.0 version
reply. Since the Proxy-Connection header is set to Keep-Alive in this
case we want to ensure we do not close in this siutation.

Task-number: QTBUG-26037

Change-Id: Icaaf2277efc0d05a946c52fb42b5191964e2e0fe
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
src/network/access/qhttpnetworkreply.cpp

index dc6f997..6790e1b 100644 (file)
@@ -537,7 +537,8 @@ qint64 QHttpNetworkReplyPrivate::readHeader(QAbstractSocket *socket)
         // 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());
+            (majorVersion == 1 && minorVersion == 0 &&
+            (connectionHeaderField.isEmpty() && !headerField("proxy-connection").toLower().contains("keep-alive")));
 
 #ifndef QT_NO_COMPRESS
         if (autoDecompress && isCompressed()) {