diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-10-26 13:45:50 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-11-11 11:48:48 (GMT) |
commit | d8213cbff66784a3e1132e278d608500f88975f2 (patch) | |
tree | 491d6decb15504b913d79bc51ba5acd6eca3a15c /src/network | |
parent | 3ae96155a760ba114fb7843154f9ae8e311162f9 (diff) | |
download | Qt-d8213cbff66784a3e1132e278d608500f88975f2.zip Qt-d8213cbff66784a3e1132e278d608500f88975f2.tar.gz Qt-d8213cbff66784a3e1132e278d608500f88975f2.tar.bz2 |
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 <peter.hartmann@nokia.com>
(cherry picked from commit 0ad18e18d1223b173d4a0d374b70ec08c3b22b11)
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/socket/qhttpsocketengine.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index 5c672ec..b62bc05 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; |