From 0ad18e18d1223b173d4a0d374b70ec08c3b22b11 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 26 Oct 2011 14:45:50 +0100 Subject: HTTP proxy engine - accept standard Connection header The Proxy-Connection header is a non standard header, but is widely used so forming a de-facto standard. Some proxies use the official Connection header, so we should check for that in responses. Otherwise https connections over http proxy fail in case the proxy sends "Connection: close" with the 407 reply. Task-number: QTBUG-22177 Change-Id: If6cfa4ebb7ac9d97d65b6ddcc8257aee20ac0448 Reviewed-by: Peter Hartmann --- src/network/socket/qhttpsocketengine.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/network/socket/qhttpsocketengine.cpp') diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index 5c672ec227..b62bc05d22 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -614,6 +614,10 @@ void QHttpSocketEngine::slotSocketReadNotification() bool willClose; QString proxyConnectionHeader = responseHeader.value(QLatin1String("Proxy-Connection")); + // Although most proxies use the unofficial Proxy-Connection header, the Connection header + // from http spec is also allowed. + if (proxyConnectionHeader.isEmpty()) + proxyConnectionHeader = responseHeader.value(QLatin1String("Connection")); proxyConnectionHeader = proxyConnectionHeader.toLower(); if (proxyConnectionHeader == QLatin1String("close")) { willClose = true; -- cgit v1.2.3