diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-10-22 13:25:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2014-11-03 10:51:07 +0100 |
commit | 2e207e29436cbe953df99783a9577a9776a200bb (patch) | |
tree | 9e684757c067cde0cd563ede69460d2e3ad9cc6d /src/network/access/qhttpnetworkconnection.cpp | |
parent | 92ce89c1efdb7ddb589528901087e4ff50e55fe2 (diff) |
Update credentials on cached http-connections
When sending a second request with implied credentials the connection
used may be cached as a connection without credentials, and thereby
incorrectly reused later for other connections with different implied
credentials.
This patch updates the credentials a cached http-connection is using
before sending a request on it.
Task-number: QTBUG-39456
Change-Id: I1609234136a89c32e00432a67720cd62a73a488a
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 365ce55f2b..6caf118c59 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -385,11 +385,12 @@ void QHttpNetworkConnectionPrivate::copyCredentials(int fromChannel, QAuthentica Q_ASSERT(auth); // NTLM is a multi phase authentication. Copying credentials between authenticators would mess things up. - if (!isProxy && channels[fromChannel].authMethod == QAuthenticatorPrivate::Ntlm) - return; - if (isProxy && channels[fromChannel].proxyAuthMethod == QAuthenticatorPrivate::Ntlm) - return; - + if (fromChannel >= 0) { + if (!isProxy && channels[fromChannel].authMethod == QAuthenticatorPrivate::Ntlm) + return; + if (isProxy && channels[fromChannel].proxyAuthMethod == QAuthenticatorPrivate::Ntlm) + return; + } // select another channel QAuthenticator* otherAuth = 0; |