summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnection.cpp
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-11-03 15:46:24 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-11-03 15:52:25 (GMT)
commitfbe7375ad3dde9ce10202141ea7ffe78643088a6 (patch)
treebf3aa146d65402aca017df88a59b451fbb2b3863 /src/network/access/qhttpnetworkconnection.cpp
parentfc60eb64d38289b448f73889139c94895b74db1a (diff)
downloadQt-fbe7375ad3dde9ce10202141ea7ffe78643088a6.zip
Qt-fbe7375ad3dde9ce10202141ea7ffe78643088a6.tar.gz
Qt-fbe7375ad3dde9ce10202141ea7ffe78643088a6.tar.bz2
QNAM: Reset authenticator state properly between requests
Reset authenticator and fix operator=(...) of QAuthenticator. Task-number: QTBUG-6792 Reviewed-by: ogoffart
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 89f9b03..4d27531 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -373,6 +373,13 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
// - If withCredentials has been set to false (e.g. by QtWebKit for a cross-origin XMLHttpRequest) then
// we need to bail out if authentication is required.
if (priv->phase == QAuthenticatorPrivate::Done || !reply->request().withCredentials()) {
+ // Reset authenticator so the next request on that channel does not get messed up
+ auth = 0;
+ if (isProxy)
+ channels[i].proxyAuthenticator = QAuthenticator();
+ else
+ channels[i].authenticator = QAuthenticator();
+
// authentication is cancelled, send the current contents to the user.
emit channels[i].reply->headerChanged();
emit channels[i].reply->readyRead();